@arcgis/core 6.0.0-next.35 → 6.0.0-next.36

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 (33) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/chunks/RibbonLine.glsl.js +158 -84
  3. package/config.js +1 -1
  4. package/kernel.js +1 -1
  5. package/package.json +2 -2
  6. package/support/timeUtils.js +1 -1
  7. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  8. package/views/3d/analysis/LineOfSight/placementUtils.js +1 -1
  9. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  10. package/views/3d/interactive/Manipulator3D.js +1 -1
  11. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  12. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  13. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  14. package/views/3d/layers/I3SMeshView3D.js +1 -1
  15. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  16. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  17. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  18. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  19. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  20. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  21. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  22. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  23. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  24. package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
  25. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  26. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  27. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  28. package/views/draw/DrawTool.js +1 -1
  29. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  30. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  31. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  32. package/widgets/OrientedImageryViewer.js +2 -2
  33. package/views/3d/webgl-engine/lib/GaussianSplatPrepassDepthRenderer.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{sliceDraw as e}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{EvaluateAmbientOcclusion as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{forwardLocalUp as ee}from"../views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js";import{mainLightIntensity as te}from"../views/3d/webgl-engine/core/shaderLibrary/shading/lightingUniforms.js";import{LineStipple as ne,computePixelSize as re}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as ie}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{PiUtils as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{positionOutsideClipSpace as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{readFragmentShadow as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/readFragmentShadow.glsl.js";import{metersPerRenderUnit as s,screenPixelSizePerDistance as c,inverseProjectionMatrix as l,nearFar as u,viewport as d,pixelRatio as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as ae}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{NoPerspectiveWrite as p,NoPerspectiveRead as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js";import{getPackedUint32Field as h}from"../views/3d/webgl-engine/core/shaderLibrary/util/PackedUint32.glsl.js";import{addProjViewLocalOrigin as g}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as _}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as y,If as b}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{ribbonLineVertexInfoPacking as x,ribbonLineVertexTypePacking as S,ribbonSubdivisionScale as oe}from"../views/3d/webgl-engine/lib/RibbonLineVertexInfo.js";import{alphaCutoff as se}from"../views/3d/webgl-engine/shaders/alphaCutoff.glsl.js";import{animatedAlpha as C}from"../views/3d/webgl-engine/shaders/animatedAlpha.glsl.js";import{groundMetersToScreenRatio as w,planarDistanceToScreenRatio as T}from"../views/3d/webgl-engine/shaders/lineUniforms.js";import{outputColorHighlightOLID as E}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{getTextureBackedBufferModule as D}from"../views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js";import{ShaderBuilder as O}from"../views/webgl/ShaderBuilder.js";const k=1;function A(k){let A=new O,{attributes:j,varyings:M,vertex:N,fragment:P}=A,{applyMarkerOffset:F,draped:I,shadingEnabled:L,output:R,capType:z,stippleEnabled:B,falloffEnabled:V,wireframe:H,innerColorEnabled:U,hasAnimation:W,hasScreenSizePerspective:G,worldSized:K,imagePattern:ce,useFlatJoinVarying:q}=k,J=z===2,Y=B&&J,X=V||Y,le=B||J,Z=B&&k.usePerspectiveCorrectStipple,Q=D(k).createBuilder(A,k);N.inputs.add(`position`,()=>Q.getTextureAttribute(`position`)),k.hasVVSize?N.inputs.add(`sizeFeatureAttribute`,()=>Q.getTextureAttribute(`sizeFeatureAttribute`)):N.inputs.add(`size`,()=>k.hasVertexSize?Q.getTextureAttribute(`size`):y`1.0`),k.hasVVOpacity&&N.inputs.add(`opacityFeatureAttribute`,()=>Q.getTextureAttribute(`opacityFeatureAttribute`)),k.hasVVColor?N.inputs.add(`colorFeatureAttribute`,()=>Q.getTextureAttribute(`colorFeatureAttribute`)):N.inputs.add(`color`,()=>k.hasVertexColor?Q.getTextureAttribute(`color`):y`vec4(1.0)`),P.include(i),A.include(t,k),A.include(ne,k),R===11?(A.varyings.add(`objectAndLayerIdColorVarying`,`vec4`),N.code.add(y`
2
+ import{sliceDraw as e}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{EvaluateAmbientOcclusion as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{forwardLocalUp as ee}from"../views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js";import{mainLightIntensity as te}from"../views/3d/webgl-engine/core/shaderLibrary/shading/lightingUniforms.js";import{LineStipple as ne,computePixelSize as re}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as ie}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{PiUtils as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{positionOutsideClipSpace as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{readFragmentShadow as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/readFragmentShadow.glsl.js";import{metersPerRenderUnit as s,screenPixelSizePerDistance as c,inverseProjectionMatrix as l,nearFar as u,viewport as d,pixelRatio as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{NoPerspectiveWrite as ae,NoPerspectiveRead as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js";import{getPackedUint32Field as h}from"../views/3d/webgl-engine/core/shaderLibrary/util/PackedUint32.glsl.js";import{addProjViewLocalOrigin as g}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as _}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as y,If as b}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{ribbonLineVertexInfoPacking as x,ribbonLineVertexTypePacking as S,ribbonSubdivisionScale as oe}from"../views/3d/webgl-engine/lib/RibbonLineVertexInfo.js";import{alphaCutoff as se}from"../views/3d/webgl-engine/shaders/alphaCutoff.glsl.js";import{animatedAlpha as ce}from"../views/3d/webgl-engine/shaders/animatedAlpha.glsl.js";import{groundMetersToScreenRatio as C,planarDistanceToScreenRatio as w}from"../views/3d/webgl-engine/shaders/lineUniforms.js";import{outputColorHighlightOLID as T}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{getTextureBackedBufferModule as E}from"../views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js";import{ShaderBuilder as D}from"../views/webgl/ShaderBuilder.js";const O=1;function k(O){let k=new D,{attributes:A,varyings:j,vertex:M,fragment:N}=k,{applyMarkerOffset:P,draped:F,shadingEnabled:I,output:L,capType:R,stippleEnabled:z,falloffEnabled:B,wireframe:V,innerColorEnabled:H,hasAnimation:U,hasScreenSizePerspective:W,worldSized:G,imagePattern:le,useFlatJoinVarying:K}=O,q=R===2,J=z&&q,Y=B||J,ue=z||q,X=z&&O.usePerspectiveCorrectStipple,Z=G&&!F,Q=E(O).createBuilder(k,O);M.inputs.add(`position`,()=>Q.getTextureAttribute(`position`)),O.hasVVSize?M.inputs.add(`sizeFeatureAttribute`,()=>Q.getTextureAttribute(`sizeFeatureAttribute`)):M.inputs.add(`size`,()=>O.hasVertexSize?Q.getTextureAttribute(`size`):y`1.0`),O.hasVVOpacity&&M.inputs.add(`opacityFeatureAttribute`,()=>Q.getTextureAttribute(`opacityFeatureAttribute`)),O.hasVVColor?M.inputs.add(`colorFeatureAttribute`,()=>Q.getTextureAttribute(`colorFeatureAttribute`)):M.inputs.add(`color`,()=>O.hasVertexColor?Q.getTextureAttribute(`color`):y`vec4(1.0)`),N.include(i),k.include(t,O),k.include(ne,O),L===11?(k.varyings.add(`objectAndLayerIdColorVarying`,`vec4`),M.code.add(y`
3
3
  vec4 getOlidColor() {
4
4
  return ${Q.getTextureAttribute(`olidColor`)};
5
5
  }
@@ -7,9 +7,9 @@ import{sliceDraw as e}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.gls
7
7
  void forwardObjectAndLayerIdColor() {
8
8
  objectAndLayerIdColorVarying = getOlidColor();
9
9
  }
10
- `),P.code.add(y`void outputObjectAndLayerIdColor() {
10
+ `),N.code.add(y`void outputObjectAndLayerIdColor() {
11
11
  fragColor = objectAndLayerIdColorVarying;
12
- }`)):(N.code.add(y`void forwardObjectAndLayerIdColor() {}`),P.code.add(y`void outputObjectAndLayerIdColor() {}`));let $=F&&!I;return $&&A.include(ie,k),g(N,k),I&&(K||B)&&N.uniforms.add(K?w:T),K&&!I&&N.uniforms.add(s,c),N.uniforms.add(l,u,d,new v(`miterLimit`,e=>e.join===`miter`?e.miterLimit:0)),N.constants.add(`LARGE_HALF_FLOAT`,`float`,65500),N.constants.add(`EPS`,`float`,.001),N.constants.add(`NUM_JOIN_SUBDIVISIONS`,`float`,k.numJoinSubdivisions),j.add(`ribbonLineVertexInfo`,`uint`),M.add(`vColor`,`vec4`),M.add(`vpos`,`vec3`,{invariant:!0}),M.add(`vLineDistance`,`float`),M.add(`vLineWidth`,`float`),q?M.add(`vIsInsideJoin`,`int`,{flat:!0}):M.add(`vPointTag`,`vec2`),M.add(`vStretchFactor`,`float`),M.add(`vJoinCenterLineSDFs`,`vec2`),M.add(`vSubdivisionFactor`,`float`),B&&M.add(`vLineSizeInv`,`float`),X&&M.add(`vLineDistanceNorm`,`float`),J&&(M.add(`vSegmentSDF`,`float`),M.add(`vReverseSegmentSDF`,`float`)),N.code.add(y`vec3 perpendicular(vec3 v) {
12
+ }`)):(M.code.add(y`void forwardObjectAndLayerIdColor() {}`),N.code.add(y`void outputObjectAndLayerIdColor() {}`));let $=P&&!F;return $&&k.include(ie,O),g(M,O),F&&(G||z)&&M.uniforms.add(G?C:w),Z&&M.uniforms.add(s,c),M.uniforms.add(l,u,d,new v(`miterLimit`,e=>e.join===`miter`?e.miterLimit:0)),M.constants.add(`LARGE_HALF_FLOAT`,`float`,65500),M.constants.add(`EPS`,`float`,.001),M.constants.add(`NUM_JOIN_SUBDIVISIONS`,`float`,O.numJoinSubdivisions),A.add(`ribbonLineVertexInfo`,`uint`),j.add(`vColor`,`vec4`),j.add(`vpos`,`vec3`,{invariant:!0}),j.add(`vLineDistance`,`float`),j.add(`vLineWidth`,`float`),K?j.add(`vIsInsideJoin`,`int`,{flat:!0}):j.add(`vPointTag`,`vec2`),j.add(`vStretchFactor`,`float`),j.add(`vJoinCenterLineSDFs`,`vec2`),Z&&j.add(`vJoinLineWidths`,`vec2`),j.add(`vSubdivisionFactor`,`float`),z&&j.add(`vLineSizeInv`,`float`),Y&&j.add(`vLineDistanceNorm`,`float`),q&&(j.add(`vSegmentSDF`,`float`),j.add(`vReverseSegmentSDF`,`float`)),M.code.add(y`vec3 perpendicular(vec3 v) {
13
13
  return vec3(v.y, -v.x, 0.0);
14
14
  }
15
15
  float nearPlaneInterpolationFactor(float nearPlaneDistance, vec4 start, vec4 end) {
@@ -20,17 +20,17 @@ float s = sin(a);
20
20
  float c = cos(a);
21
21
  mat2 m = mat2(c, -s, s, c);
22
22
  return vec3(m * v.xy, v.z);
23
- }`),N.code.add(y`vec4 projectAndScale(vec4 pos) {
23
+ }`),M.code.add(y`vec4 projectAndScale(vec4 pos) {
24
24
  vec4 posNdc = proj * pos;
25
25
  posNdc.xy *= viewport.zw / posNdc.w;
26
26
  posNdc.z /= posNdc.w;
27
27
  return posNdc;
28
- }`),N.code.add(y`
28
+ }`),M.code.add(y`
29
29
  void clip(
30
30
  inout vec4 pos,
31
31
  inout vec4 prev,
32
32
  inout vec4 next,
33
- ${b(Z,y`inout float u0, inout float prevU0, inout float nextU0,`)}
33
+ ${b(X,y`inout float u0, inout float prevU0, inout float nextU0,`)}
34
34
  bool isStartVertex
35
35
  ) {
36
36
  float adjustedNearPlaneDistance = nearFar[0] * 0.99;
@@ -41,7 +41,7 @@ return posNdc;
41
41
  if (prev.z < -nearFar[0]) {
42
42
  // Previous position in front of near plane
43
43
  float clipFactor = nearPlaneInterpolationFactor(adjustedNearPlaneDistance, prev, pos);
44
- ${b(Z,y`u0 = mix(prevU0, u0, clipFactor); nextU0 = u0;`)}
44
+ ${b(X,y`u0 = mix(prevU0, u0, clipFactor); nextU0 = u0;`)}
45
45
  pos = mix(prev, pos, clipFactor);
46
46
  next = pos;
47
47
  } else {
@@ -51,7 +51,7 @@ return posNdc;
51
51
  if (next.z < -nearFar[0]) {
52
52
  // Next position in front of near plane
53
53
  float clipFactor = nearPlaneInterpolationFactor(adjustedNearPlaneDistance, pos, next);
54
- ${b(Z,y`u0 = mix(u0, nextU0, clipFactor); prevU0 = u0;`)}
54
+ ${b(X,y`u0 = mix(u0, nextU0, clipFactor); prevU0 = u0;`)}
55
55
  pos = mix(pos, next, clipFactor);
56
56
  prev = pos;
57
57
  } else {
@@ -63,36 +63,36 @@ return posNdc;
63
63
  if (prev.z > -nearFar[0]) {
64
64
  // Previous position behind near plane
65
65
  float clipFactor = nearPlaneInterpolationFactor(adjustedNearPlaneDistance, pos, prev);
66
- ${b(Z,y`prevU0 = mix(u0, prevU0, clipFactor);`)}
66
+ ${b(X,y`prevU0 = mix(u0, prevU0, clipFactor);`)}
67
67
  prev = mix(pos, prev, clipFactor);
68
68
  }
69
69
 
70
70
  if (next.z > -nearFar[0]) {
71
71
  // Next position behind near plane
72
72
  float clipFactor = nearPlaneInterpolationFactor(adjustedNearPlaneDistance, next, pos);
73
- ${b(Z,y`nextU0 = mix(nextU0, u0, clipFactor);`)}
73
+ ${b(X,y`nextU0 = mix(nextU0, u0, clipFactor);`)}
74
74
  next = mix(next, pos, clipFactor);
75
75
  }
76
76
  }
77
77
  }
78
- `),N.uniforms.add(f),N.constants.add(`aaWidth`,`float`,1),P.constants.add(`aaWidth`,`float`,1),N.main.add(y`
78
+ `),M.uniforms.add(f),M.constants.add(`aaWidth`,`float`,1),N.constants.add(`aaWidth`,`float`,1),M.main.add(y`
79
79
  uint vertexType = ${h(x,1,y`ribbonLineVertexInfo`)};
80
80
  bool isJoin = ${h(S,0,y`vertexType`)} == 0u;
81
81
  float lineSide = ${h(S,1,y`vertexType`)} == 0u ? 1.0 : -1.0;
82
82
  bool isStartVertex = ${h(S,2,y`vertexType`)} != 0u;
83
83
  float subdivisionFactor = float(${h(x,2,y`ribbonLineVertexInfo`)}) / ${y.float(oe)};
84
84
  vec3 position = ${Q.getTextureAttribute(`position`)};
85
- ${B?y`float u0 = ${Q.getTextureAttribute(`u0`)};`:``}
86
- ${B&&K?y`
85
+ ${z?y`float u0 = ${Q.getTextureAttribute(`u0`)};`:``}
86
+ ${z&&G?y`
87
87
  float prevU0 = ${Q.getTextureAttribute(`u0`,-1)};
88
88
  float nextU0 = ${Q.getTextureAttribute(`u0`,1)};
89
- ${b(!I,y`
89
+ ${b(!F,y`
90
90
  u0 *= metersPerRenderUnit;
91
91
  prevU0 *= metersPerRenderUnit;
92
92
  nextU0 *= metersPerRenderUnit;
93
93
  `)}
94
94
  `:``}
95
- ${b(!q,y`
95
+ ${b(!K,y`
96
96
  float textureIndexParity = float(${h(x,0,y`ribbonLineVertexInfo`)} % 2u);
97
97
  vPointTag = vec2(textureIndexParity, 1.0 - textureIndexParity);
98
98
  `)}
@@ -107,11 +107,47 @@ return posNdc;
107
107
  vec4 pos = view * vec4(position, 1.0);
108
108
  vec4 prev = view * vec4(prevPosition, 1.0);
109
109
  vec4 next = view * vec4(nextPosition, 1.0);
110
- `),$&&N.main.add(y`vec4 other = isStartVertex ? next : prev;
110
+ `),$&&M.main.add(y`vec4 other = isStartVertex ? next : prev;
111
111
  bool markersHidden = areWorldMarkersHidden(pos.xyz, other.xyz);
112
112
  if (!isJoin && !markersHidden) {
113
113
  pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
114
- }`),A.include(p),N.code.add(y`
114
+ }`),k.include(ae),Z&&M.code.add(y`vec2 computePerspectiveInnerJoin(
115
+ vec2 leftDirection,
116
+ vec2 rightDirection,
117
+ float leftLength,
118
+ float rightLength,
119
+ float previousWidth,
120
+ float currentWidth,
121
+ float nextWidth,
122
+ float lineSide,
123
+ bool isStartVertex
124
+ ) {
125
+ vec2 leftNormal = vec2(leftDirection.y, -leftDirection.x) * lineSide;
126
+ vec2 rightNormal = vec2(rightDirection.y, -rightDirection.x) * lineSide;
127
+ vec2 segmentOffset = (isStartVertex ? rightNormal : leftNormal) * currentWidth;
128
+ if (min(leftLength, rightLength) <= EPS) {
129
+ return segmentOffset;
130
+ }
131
+ vec2 leftEdge = leftDirection + leftNormal * ((currentWidth - previousWidth) / leftLength);
132
+ vec2 rightEdge = rightDirection + rightNormal * ((nextWidth - currentWidth) / rightLength);
133
+ vec2 offset = (rightNormal - leftNormal) * currentWidth;
134
+ float determinant = leftEdge.x * rightEdge.y - leftEdge.y * rightEdge.x;
135
+ float determinantScale = length(leftEdge) * length(rightEdge);
136
+ const float parallelTolerance = EPS * EPS;
137
+ if (!(abs(determinant) > parallelTolerance * determinantScale)) {
138
+ return segmentOffset;
139
+ }
140
+ float leftDistance = (offset.x * rightEdge.y - offset.y * rightEdge.x) / determinant;
141
+ float rightDistance = (offset.x * leftEdge.y - offset.y * leftEdge.x) / determinant;
142
+ if (!(leftDistance >= -leftLength && leftDistance <= 0.0 &&
143
+ rightDistance >= 0.0 && rightDistance <= rightLength)) {
144
+ return segmentOffset;
145
+ }
146
+ return leftNormal * currentWidth + leftDistance * leftEdge;
147
+ }`),Z&&M.code.add(y`float perspectiveWidthAtOffset(vec2 offset, vec2 segment, float widthAtOrigin, float widthChange) {
148
+ float segmentFraction = dot(offset, segment) / max(dot(segment, segment), EPS * EPS);
149
+ return widthAtOrigin + segmentFraction * widthChange;
150
+ }`),M.code.add(y`
115
151
  vec2 computeJoinAndCapDisplacement(
116
152
  bool isJoin,
117
153
  bool isStartVertex,
@@ -119,11 +155,12 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
119
155
  inout vec3 right,
120
156
  float lineSide,
121
157
  float lineWidth,
158
+ ${b(Z,`vec2 neighborWidths,`)}
122
159
  float subdivisionFactor,
123
160
  float perspectiveDivisor
124
161
  ) {
125
- float leftLen = length(left);
126
- float rightLen = length(right);
162
+ float leftLen = length(${b(Z,y`left.xy`,y`left`)});
163
+ float rightLen = length(${b(Z,y`right.xy`,y`right`)});
127
164
  left = leftLen > EPS ? left / leftLen : vec3(0.0);
128
165
  right = rightLen > EPS ? right / rightLen : vec3(0.0);
129
166
 
@@ -133,31 +170,50 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
133
170
  float miterDisplacementLen = lineWidth;
134
171
  float innerDisplacementLen = lineWidth;
135
172
  bool isOutside = false;
173
+ ${b(Z,`vec2 innerDisplacement = vec2(0.0);`)}
136
174
 
137
175
  if (isJoin) {
138
176
  // Determine if the vertex is on the outside or inside of the join.
139
177
  isOutside = (left.x * right.y - left.y * right.x) * lineSide > 0.0;
140
178
 
141
179
  // Compute the miter join position first.
142
- vec3 joinDirection = normalize(left + right);
143
- joinDisplacementDir = perpendicular(joinDirection);
144
-
145
- // Compute the miter stretch.
146
- if (leftLen > EPS && rightLen > EPS) {
147
- float nDotSeg = dot(joinDisplacementDir, left);
148
- displacementLen /= length(nDotSeg * left - joinDisplacementDir);
149
- miterDisplacementLen = displacementLen;
150
-
151
- innerDisplacementLen = min(displacementLen, min(leftLen, rightLen) / abs(nDotSeg));
152
-
153
- // Limit displacement of inner vertices.
154
- if (!isOutside) {
155
- displacementLen = innerDisplacementLen;
156
- }
157
- }
180
+ ${b(Z,y`
181
+ vec2 bisector = left.xy + right.xy;
182
+ vec2 segmentDirection = isStartVertex ? right.xy : left.xy;
183
+ vec3 joinDirection = vec3(length(bisector) > EPS ? normalize(bisector) : segmentDirection, 0.0);
184
+ joinDisplacementDir = perpendicular(joinDirection);
185
+
186
+ if (leftLen > EPS && rightLen > EPS) {
187
+ float nDotSeg = dot(joinDisplacementDir, left);
188
+ displacementLen /= length(nDotSeg * left.xy - joinDisplacementDir.xy);
189
+ miterDisplacementLen = displacementLen;
190
+ }
191
+
192
+ innerDisplacement = computePerspectiveInnerJoin(
193
+ left.xy, right.xy, leftLen, rightLen,
194
+ neighborWidths.x, lineWidth, neighborWidths.y,
195
+ isOutside ? -lineSide : lineSide, isStartVertex
196
+ );
197
+ innerDisplacementLen = length(innerDisplacement);
198
+ `,y`
199
+ vec3 joinDirection = normalize(left + right);
200
+ joinDisplacementDir = perpendicular(joinDirection);
201
+
202
+ if (leftLen > EPS && rightLen > EPS) {
203
+ float nDotSeg = dot(joinDisplacementDir, left);
204
+ displacementLen /= length(nDotSeg * left - joinDisplacementDir);
205
+ miterDisplacementLen = displacementLen;
206
+ innerDisplacementLen = min(displacementLen, min(leftLen, rightLen) / abs(nDotSeg));
207
+
208
+ // Limit displacement of inner vertices.
209
+ if (!isOutside) {
210
+ displacementLen = innerDisplacementLen;
211
+ }
212
+ }
213
+ `)}
158
214
 
159
215
  // Compute stretch compensation for feathering.
160
- ${b(q,y`
216
+ ${b(K,y`
161
217
  if (subdivisionFactor > 0.0) {
162
218
  vIsInsideJoin = 1;
163
219
  }
@@ -191,10 +247,10 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
191
247
  }
192
248
 
193
249
  if (isOutside && displacementLen > miterLimit * lineWidth) {
194
- ${b(k.roundJoins,y`
250
+ ${b(O.roundJoins,y`
195
251
  vec3 startDir = perpendicular(leftLen < EPS ? right : left);
196
252
  vec3 endDir = perpendicular(rightLen < EPS ? left : right);
197
- float factor = ${B?y`min(1.0, subdivisionFactor * ((NUM_JOIN_SUBDIVISIONS + 1.0) / NUM_JOIN_SUBDIVISIONS))`:y`subdivisionFactor`};
253
+ float factor = ${z?y`min(1.0, subdivisionFactor * ((NUM_JOIN_SUBDIVISIONS + 1.0) / NUM_JOIN_SUBDIVISIONS))`:y`subdivisionFactor`};
198
254
 
199
255
  float rotationAngle = acos(clamp(dot(startDir.xy, endDir.xy), -1.0, 1.0));
200
256
  joinDisplacementDir = rotateZ(startDir, -lineSide * factor * rotationAngle);
@@ -210,19 +266,24 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
210
266
  vec3 startDir = perpendicular(leftLen < EPS ? right : left);
211
267
  vec3 endDir = perpendicular(rightLen < EPS ? left : right);
212
268
 
213
- ${b(B,y`joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? endDir : startDir;`,y`joinDisplacementDir = mix(startDir, endDir, subdivisionFactor);`)}
269
+ ${b(z,y`joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? endDir : startDir;`,y`joinDisplacementDir = mix(startDir, endDir, subdivisionFactor);`)}
214
270
  `)}
215
271
  displacementLen = lineWidth;
216
272
  }
217
273
  } else {
218
274
  joinDisplacementDir = perpendicular(isStartVertex ? right : left);
219
- ${z===0?``:y`capDisplacementDir = vec3((isStartVertex ? -right : left).xy, 0.0);`}
275
+ ${R===0?``:y`capDisplacementDir = vec3((isStartVertex ? -right : left).xy, 0.0);`}
220
276
  }
221
277
 
278
+ ${b(Z,y`
279
+ if (isJoin && !isOutside) {
280
+ return innerDisplacement;
281
+ }
282
+ `)}
222
283
  return (joinDisplacementDir.xy * lineSide + capDisplacementDir.xy) * displacementLen;
223
284
  }
224
- `),N.main.add(y`
225
- clip(pos, prev, next, ${b(Z,y`u0, prevU0, nextU0,`)} isStartVertex);
285
+ `),M.main.add(y`
286
+ clip(pos, prev, next, ${b(X,y`u0, prevU0, nextU0,`)} isStartVertex);
226
287
 
227
288
  vec3 clippedPos = pos.xyz;
228
289
  vec3 clippedCenter = mix(pos.xyz, isStartVertex ? next.xyz : prev.xyz, 0.5);
@@ -234,14 +295,14 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
234
295
  vec3 left = (pos.xyz - prev.xyz);
235
296
  vec3 right = (next.xyz - pos.xyz);
236
297
 
237
- float lineSize = getSize(${b(G,`clippedPos`)});
238
- ${b(B&&G,`float patternLineSize = getSize(clippedCenter);`)}
239
- ${b(B&&!G,`float patternLineSize = lineSize;`)}
298
+ float lineSize = getSize(${b(W,`clippedPos`)});
299
+ ${b(z&&W,`float patternLineSize = getSize(clippedCenter);`)}
300
+ ${b(z&&!W,`float patternLineSize = lineSize;`)}
240
301
 
241
- ${b(K,y`
242
- ${b(I,y`float lineSizeScreen = lineSize * groundMetersToScreenRatio;`,y`
243
- float metersPerScreenPixel = max(-clippedPos.z, nearFar[0]) * metersPerRenderUnit * screenPixelSizePerDistance;
244
- float lineSizeScreen = lineSize / metersPerScreenPixel;
302
+ ${b(G,y`
303
+ ${b(F,y`float lineSizeScreen = lineSize * groundMetersToScreenRatio;`,y`
304
+ float widthPerInverseDepth = lineSize / (metersPerRenderUnit * screenPixelSizePerDistance);
305
+ float lineSizeScreen = widthPerInverseDepth / max(-clippedPos.z, nearFar[0]);
245
306
  `)}
246
307
  float lineWidth = lineSizeScreen * pixelRatio + aaWidth;
247
308
  `,y`
@@ -249,18 +310,22 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
249
310
  `)}
250
311
 
251
312
  vLineWidth = noPerspectiveWrite(lineWidth, pos.w);
252
- ${B?`vLineSizeInv = noPerspectiveWrite(1.0 / ${K?`lineSize`:`max(lineSize, 1.0)`}, pos.w);`:``}
253
- `),le&&N.main.add(y`
313
+ ${z?`vLineSizeInv = noPerspectiveWrite(1.0 / ${G?`lineSize`:`max(lineSize, 1.0)`}, pos.w);`:``}
314
+ `),ue&&M.main.add(y`
254
315
  float isEndVertex = float(!isStartVertex);
255
316
  vec3 segmentOrigin = mix(pos.xyz, prev.xyz, isEndVertex);
256
317
  vec3 segment = mix(right, left, isEndVertex);
257
- ${J?`vec3 segmentEnd = mix(next.xyz, pos.xyz, isEndVertex);`:``}
258
- `),N.main.add(y`
259
- ${b(q,y`vIsInsideJoin = 0;`)}
318
+ ${q?`vec3 segmentEnd = mix(next.xyz, pos.xyz, isEndVertex);`:``}
319
+ `),M.main.add(y`
320
+ ${b(K,y`vIsInsideJoin = 0;`)}
260
321
  vStretchFactor = 1.0;
261
322
  vSubdivisionFactor = 0.0;
262
323
  vJoinCenterLineSDFs = vec2(LARGE_HALF_FLOAT);
263
324
 
325
+ ${b(Z,y`
326
+ vec2 neighborWidths = widthPerInverseDepth / max(vec2(prev.w, next.w), vec2(nearFar[0])) * pixelRatio + aaWidth;
327
+ `)}
328
+
264
329
  vec2 displacementXY = computeJoinAndCapDisplacement(
265
330
  isJoin,
266
331
  isStartVertex,
@@ -268,9 +333,17 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
268
333
  right,
269
334
  lineSide,
270
335
  lineWidth,
336
+ ${b(Z,`neighborWidths,`)}
271
337
  subdivisionFactor,
272
338
  pos.w
273
339
  );
340
+ ${b(Z,y`
341
+ // Feathering must use each strip's width at the displaced vertex, not at the original join.
342
+ float leftWidth = perspectiveWidthAtOffset(displacementXY, pos.xy - prev.xy, lineWidth, lineWidth - neighborWidths.x);
343
+ float rightWidth = perspectiveWidthAtOffset(displacementXY, next.xy - pos.xy, lineWidth, neighborWidths.y - lineWidth);
344
+ // Match vJoinCenterLineSDFs: right first, selected when vSubdivisionFactor > 0.5.
345
+ vJoinLineWidths = noPerspectiveWrite(vec2(rightWidth, leftWidth), pos.w);
346
+ `)}
274
347
  vec3 segmentDirection = isStartVertex ? right : left;
275
348
 
276
349
  /**
@@ -285,10 +358,10 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
285
358
  float lineDistNorm = noPerspectiveWrite(lineSide, pos.w);
286
359
 
287
360
  vLineDistance = lineWidth * lineDistNorm;
288
- ${X?y`vLineDistanceNorm = lineDistNorm;`:``}
361
+ ${Y?y`vLineDistanceNorm = lineDistNorm;`:``}
289
362
 
290
363
  pos.xyz += displacement;
291
- `),N.main.add(y`if (isJoin) {
364
+ `),M.main.add(y`if (isJoin) {
292
365
  vec2 joinCenterToVertex = displacementXY;
293
366
  vec2 leftCenterlineDir = left.xy;
294
367
  vec2 rightCenterlineDir = right.xy;
@@ -303,31 +376,31 @@ dot(vec2(leftCenterlineDir.y, -leftCenterlineDir.x), joinCenterToVertex)
303
376
  ),
304
377
  pos.w
305
378
  );
306
- }`),J&&N.main.add(y`vec2 segmentDir = normalize(segment.xy);
379
+ }`),q&&M.main.add(y`vec2 segmentDir = normalize(segment.xy);
307
380
  vSegmentSDF = noPerspectiveWrite((isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin.xy, segmentDir)), pos.w);
308
- vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd.xy, -segmentDir)), pos.w);`),B&&(I?N.main.add(`float stippleDistanceToScreenRatio = ${K?`groundMetersToScreenRatio`:`planarDistanceToScreenRatio`};`):N.main.add(y`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
309
- float stippleDistanceToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),N.main.add(y`
381
+ vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd.xy, -segmentDir)), pos.w);`),z&&(F?M.main.add(`float stippleDistanceToScreenRatio = ${G?`groundMetersToScreenRatio`:`planarDistanceToScreenRatio`};`):M.main.add(y`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
382
+ float stippleDistanceToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),M.main.add(y`
310
383
  float segmentLengthScreenDouble = length(segment.xy);
311
384
  float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
312
385
  float discreteStippleDistanceToScreenRatio = discretizeStippleDistanceToScreenRatio(stippleDistanceToScreenRatio);
313
- float segmentLengthRender = ${b(K,y`abs(mix(nextU0 - u0, u0 - prevU0, isEndVertex))`,y`length(mix(nextPosition - position, position - prevPosition, isEndVertex))`)};
386
+ float segmentLengthRender = ${b(G,y`abs(mix(nextU0 - u0, u0 - prevU0, isEndVertex))`,y`length(mix(nextPosition - position, position - prevPosition, isEndVertex))`)};
314
387
 
315
- ${b(!I||K,y`
316
- float segmentStartRender = ${b(K,y`mix(u0, prevU0, isEndVertex)`,y`mix(u0, u0 - segmentLengthRender, isEndVertex)`)};
388
+ ${b(!F||G,y`
389
+ float segmentStartRender = ${b(G,y`mix(u0, prevU0, isEndVertex)`,y`mix(u0, u0 - segmentLengthRender, isEndVertex)`)};
317
390
  `)}
318
391
 
319
392
  vStipplePatternStretch = stippleDistanceToScreenRatio / discreteStippleDistanceToScreenRatio;
320
- `),I?N.main.add(y`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteStippleDistanceToScreenRatio / stippleDistanceToScreenRatio;
321
- float startPseudoScreen = u0 * discreteStippleDistanceToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):N.main.add(y`float startPseudoScreen = segmentStartRender * discreteStippleDistanceToScreenRatio;
322
- float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceToScreenRatio;`),N.uniforms.add(new v(`stipplePatternPixelSize`,e=>re(e))),N.main.add(y`
393
+ `),F?M.main.add(y`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteStippleDistanceToScreenRatio / stippleDistanceToScreenRatio;
394
+ float startPseudoScreen = u0 * discreteStippleDistanceToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):M.main.add(y`float startPseudoScreen = segmentStartRender * discreteStippleDistanceToScreenRatio;
395
+ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceToScreenRatio;`),M.uniforms.add(new v(`stipplePatternPixelSize`,e=>re(e))),M.main.add(y`
323
396
  float patternLength = patternLineSize * stipplePatternPixelSize;
324
397
  vec2 stippleDistanceLimits;
325
398
 
326
- ${b(K,y`
399
+ ${b(G,y`
327
400
  stippleDistanceLimits = vec2(segmentStartRender, segmentStartRender + segmentLengthRender);
328
401
  vStipplePatternStretch = 1.0;
329
402
 
330
- ${b(ce,y`
403
+ ${b(le,y`
331
404
  // The v-coordinate used in case of an image pattern.
332
405
  bool isLeft = lineSide < 0.0;
333
406
  vStippleV = isLeft ? 0.0 : 1.0;
@@ -352,7 +425,7 @@ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceT
352
425
  vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (stippleDistanceLimits.y - stippleDistanceLimits.x);
353
426
  }
354
427
 
355
- ${b(Z,y`
428
+ ${b(X,y`
356
429
  float segmentStartInverseW = 1.0 / mix(pos.w, prev.w, isEndVertex);
357
430
  float segmentEndInverseW = 1.0 / mix(next.w, pos.w, isEndVertex);
358
431
  vStipplePerspective = noPerspectiveWrite(
@@ -368,7 +441,7 @@ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceT
368
441
  // Disable stipple distance limits on caps
369
442
  vStippleLimitsAndCaps.zw = isJoin ? vec2(0.0) :
370
443
  isStartVertex ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
371
- `)),N.main.add(y`
444
+ `)),M.main.add(y`
372
445
  // Convert back into NDC
373
446
  pos.xy = (pos.xy / viewport.zw) * pos.w;
374
447
  pos.z = pos.z * pos.w;
@@ -376,50 +449,51 @@ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceT
376
449
  vColor = getColor();
377
450
  vColor.a = noPerspectiveWrite(vColor.a, pos.w);
378
451
 
379
- ${H&&!I?`pos.z -= EPS * pos.w;`:``}
452
+ ${V&&!F?`pos.z -= EPS * pos.w;`:``}
380
453
 
381
454
  // transform final position to camera space for slicing
382
455
  vpos = (inverseProjectionMatrix * pos).xyz;
383
456
  gl_Position = pos;
384
457
  forwardObjectAndLayerIdColor();
385
- }`),A.include(E,k),A.include(m),P.include(ae),P.include(se),P.include(e,k),P.main.add(`discardBySlice(vpos);`),P.code.add(y`
458
+ }`),k.include(T,O),k.include(m),N.include(p),N.include(se),N.include(e,O),N.main.add(`discardBySlice(vpos);`),N.code.add(y`
386
459
  float lineFeatheringFactor(float lineWidth, float lineDistance) {
387
460
  /**
388
461
  * Determine whether we are inside the feathering region or not, under
389
462
  * consideration of triangle stretch and the distance to the centerline.
390
463
  */
391
- bool isInsideJoin = ${q?y`vIsInsideJoin == 1`:y`any(equal(vPointTag, vec2(0.0)))`};
464
+ bool isInsideJoin = ${K?y`vIsInsideJoin == 1`:y`any(equal(vPointTag, vec2(0.0)))`};
392
465
  float stretchFactor = isInsideJoin ? noPerspectiveRead(vStretchFactor) : 1.0;
393
466
  float featherWidth = 2.0;
394
467
  // Keep the filter in render-target pixels, including when its two sides overlap on a subpixel stroke.
395
468
  float featherStartDistance = lineWidth - featherWidth / stretchFactor;
396
- float straightFeatherStartDistance = lineWidth - featherWidth;
469
+ float straightLineWidth = ${Z?y`noPerspectiveRead(vSubdivisionFactor > 0.5 ? vJoinLineWidths.x : vJoinLineWidths.y)`:`lineWidth`};
470
+ float straightFeatherStartDistance = straightLineWidth - featherWidth;
397
471
  float value = abs(lineDistance);
398
472
  float feather = (value - featherStartDistance) / (lineWidth - featherStartDistance);
399
473
  vec2 joinCenterSDFs = noPerspectiveRead(vJoinCenterLineSDFs);
400
474
  float joinCenterDistance = abs(vSubdivisionFactor > 0.5 ? joinCenterSDFs.x : joinCenterSDFs.y);
401
- float straightFeather = (joinCenterDistance - straightFeatherStartDistance) / (lineWidth - straightFeatherStartDistance);
475
+ float straightFeather = (joinCenterDistance - straightFeatherStartDistance) / featherWidth;
402
476
  feather = isInsideJoin ? max(feather, straightFeather) : feather;
403
477
  float coverage = min(lineWidth - aaWidth, 1.0);
404
478
  return clamp(1.0 - feather, 0.0, coverage);
405
479
  }
406
- `),P.main.add(y`
480
+ `),N.main.add(y`
407
481
  float lineWidth = noPerspectiveRead(vLineWidth);
408
482
  float lineDistance = noPerspectiveRead(vLineDistance);
409
- ${b(X,y`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
410
- `),Y&&P.main.add(y`float nominalLineWidth = lineWidth - aaWidth;`),H?P.main.add(y`vec4 albedo = vec4(1.0, 0.0, 1.0, 1.0);
411
- vec4 finalColor = albedo;`):(J&&P.main.add(y`
483
+ ${b(Y,y`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
484
+ `),J&&N.main.add(y`float nominalLineWidth = lineWidth - aaWidth;`),V?N.main.add(y`vec4 albedo = vec4(1.0, 0.0, 1.0, 1.0);
485
+ vec4 finalColor = albedo;`):(q&&N.main.add(y`
412
486
  float sdf = noPerspectiveRead(min(vSegmentSDF, vReverseSegmentSDF));
413
487
  vec2 fragmentPosition = vec2(min(sdf, 0.0), lineDistance);
414
488
 
415
489
  float fragmentRadius = length(fragmentPosition);
416
- float fragmentCapSDF = (fragmentRadius - ${Y?`nominalLineWidth`:`lineWidth`}) * 0.5; // Divide by 2 to transform from double pixel scale
490
+ float fragmentCapSDF = (fragmentRadius - ${J?`nominalLineWidth`:`lineWidth`}) * 0.5; // Divide by 2 to transform from double pixel scale
417
491
  float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
418
492
 
419
493
  if (capCoverage < alphaCutoff) {
420
494
  discard;
421
495
  }
422
- `),Y?P.main.add(y`vec2 stipplePosition = vec2(
496
+ `),J?N.main.add(y`vec2 stipplePosition = vec2(
423
497
  min(getStippleCapDistance(), 0.0) * nominalLineWidth,
424
498
  lineDistance
425
499
  );
@@ -427,11 +501,11 @@ float stippleRadius = length(stipplePosition);
427
501
  float stippleCapSDF = (stippleRadius - nominalLineWidth) * 0.5;
428
502
  float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
429
503
  float lineCoverage = min(lineFeatheringFactor(lineWidth, lineDistance), capCoverage);
430
- float stippleAlpha = lineCoverage > 0.0 ? min(stippleCoverage, lineCoverage) / lineCoverage : 0.0;`):P.main.add(y`float stippleAlpha = getStippleAlpha(lineWidth);`),R!==11&&P.main.add(y`discardByStippleAlpha(stippleAlpha, alphaCutoff);`),P.uniforms.add(new _(`intrinsicColor`,e=>e.color)).main.add(y`vec4 color = intrinsicColor * vColor;
431
- color.a = noPerspectiveRead(color.a);`),U&&P.uniforms.add(new _(`innerColor`,e=>e.innerColor??e.color),new v(`innerWidth`,(e,t)=>e.innerWidth*t.camera.pixelRatio)).main.add(y`float distToInner = abs(lineDistance) - innerWidth;
504
+ float stippleAlpha = lineCoverage > 0.0 ? min(stippleCoverage, lineCoverage) / lineCoverage : 0.0;`):N.main.add(y`float stippleAlpha = getStippleAlpha(lineWidth);`),L!==11&&N.main.add(y`discardByStippleAlpha(stippleAlpha, alphaCutoff);`),N.uniforms.add(new _(`intrinsicColor`,e=>e.color)).main.add(y`vec4 color = intrinsicColor * vColor;
505
+ color.a = noPerspectiveRead(color.a);`),H&&N.uniforms.add(new _(`innerColor`,e=>e.innerColor??e.color),new v(`innerWidth`,(e,t)=>e.innerWidth*t.camera.pixelRatio)).main.add(y`float distToInner = abs(lineDistance) - innerWidth;
432
506
  float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
433
507
  float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
434
- color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),P.main.add(`vec4 albedo = blendStipple(color, stippleAlpha);`),V&&(P.uniforms.add(new v(`falloff`,e=>e.falloff)),P.main.add(y`albedo.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),P.main.add(y`albedo.a *= ${Y?`lineCoverage`:`lineFeatheringFactor(lineWidth, lineDistance)`};`),W&&(N.main.add(`vec4 animatedAlphaTimeStamps = ${Q.getTextureAttribute(`timeStamps`)};`),A.include(C,k),P.main.add(`albedo.a *= animatedAlpha();`)),L?(A.include(ee,k),N.main.add(y`forwardLocalUp(position, localOrigin);`),N.main.add(`forwardLinearDepthToReadShadow();`),A.include(o,k),P.include(r,k),P.include(n,k),P.uniforms.add(te).main.add(y`vec3 normal = normalize(upNormal);
508
+ color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),N.main.add(`vec4 albedo = blendStipple(color, stippleAlpha);`),B&&(N.uniforms.add(new v(`falloff`,e=>e.falloff)),N.main.add(y`albedo.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),N.main.add(y`albedo.a *= ${J?`lineCoverage`:`lineFeatheringFactor(lineWidth, lineDistance)`};`),U&&(M.main.add(`vec4 animatedAlphaTimeStamps = ${Q.getTextureAttribute(`timeStamps`)};`),k.include(ce,O),N.main.add(`albedo.a *= animatedAlpha();`)),I?(k.include(ee,O),M.main.add(y`forwardLocalUp(position, localOrigin);`),M.main.add(`forwardLinearDepthToReadShadow();`),k.include(o,O),N.include(r,O),N.include(n,O),N.uniforms.add(te).main.add(y`vec3 normal = normalize(upNormal);
435
509
  float additionalAmbientScale = additionalDirectedAmbientLight(normal);
436
510
  float shadow = readFragmentShadow(additionalAmbientScale);
437
511
  float ssao = evaluateAmbientOcclusionInverse();
@@ -440,4 +514,4 @@ vec3 viewDirection = normalize((inverseViewMatrix * vec4(vpos, 0.0)).xyz);
440
514
  vec4 finalColor = vec4(
441
515
  evaluateSceneLighting(normal, albedo.rgb, shadow, 1.0 - ssao, additionalLight,viewDirection, normal),
442
516
  albedo.a
443
- );`)):P.main.add(`vec4 finalColor = albedo;`)),P.main.add(y`outputColorHighlightOLID(applySlice(finalColor, vpos), albedo.rgb);`),A}const j=Object.freeze(Object.defineProperty({__proto__:null,build:A,numRoundJoinSubdivisions:1},Symbol.toStringTag,{value:`Module`}));export{j as R,A as b,k as n};
517
+ );`)):N.main.add(`vec4 finalColor = albedo;`)),N.main.add(y`outputColorHighlightOLID(applySlice(finalColor, vpos), albedo.rgb);`),k}const A=Object.freeze(Object.defineProperty({__proto__:null,build:k,numRoundJoinSubdivisions:1},Symbol.toStringTag,{value:`Module`}));export{A as R,k as b,O as n};
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),t.assetsPath||(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@6.0.0-next.35/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),t.assetsPath||(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@6.0.0-next.36/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`6.0`;let n=`6.0`;n=`6.0.0-next.35`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`6.0`;let n=`6.0`;n=`6.0.0-next.36`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.35",
3
+ "version": "6.0.0-next.36",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.21.5",
23
- "@arcgis/toolkit": "6.0.0-next.35",
23
+ "@arcgis/toolkit": "6.0.0-next.36",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0",
25
25
  "@esri/calcite-components": "^5.2.1",
26
26
  "@vaadin/grid": "~25.3.5",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isSome as e}from"../core/arrayUtils.js";import{clone as t}from"../core/lang.js";import{offsetDate as n}from"../core/timeUtils.js";import r from"../rest/support/StatisticDefinition.js";import i from"../time/TimeExtent.js";import{isWebMap as a}from"../webmap/utils.js";import{isWebScene as o}from"../webscene/utils.js";function s(e){return e.timeInfo!==void 0}async function c(t,n){if(!t.timeInfo||!t.timeInfo.startField&&!t.timeInfo.endField)return null;let{startField:a,endField:o}=t.timeInfo,s=t.createQuery();s.outStatistics=[],a&&s.outStatistics.push(new r({onStatisticField:a,outStatisticFieldName:`minStart`,statisticType:`min`}),new r({onStatisticField:a,outStatisticFieldName:`maxStart`,statisticType:`max`})),o&&s.outStatistics.push(new r({onStatisticField:o,outStatisticFieldName:`minEnd`,statisticType:`min`}),new r({onStatisticField:o,outStatisticFieldName:`maxEnd`,statisticType:`max`}));let{features:c}=await t.queryFeatures(s,{signal:n}),l=c.at(0),u=[l?.getAttribute(`minStart`),l?.getAttribute(`maxStart`),l?.getAttribute(`minEnd`),l?.getAttribute(`maxEnd`)].filter(e).map(e=>typeof e==`string`?Date.parse(e):e);if(!u.length)return null;let d=new Date(Math.min(...u)),f=new Date(Math.max(...u)),p=new i({start:d,end:f}),{visibilityTimeExtent:m}=t;return p?.intersection(m)??m}async function l(e,t){return e.widgets?.timeSlider?.fullTimeExtent??f(e.allLayers,t)}function u(e){let t=e.numThumbs??2,n=e.currentTimeExtent;if(n){let{start:e,end:r}=n;return e!=null&&r!=null&&e.getTime()===r.getTime()?`instant`:t===2?`time-window`:e==null||e.getTime()===0?`cumulative-from-start`:`cumulative-from-end`}return t===2?`time-window`:`cumulative-from-start`}function d(e){let{numStops:n,stopInterval:r,stops:i}=e;return i?{dates:t(i)}:r?{interval:r.clone()}:{count:n??5}}async function f(t,n){if(t.length===0)return i.allTime;await Promise.all(t.map(e=>e.load({signal:n})));let r=t.filter(s),a=t.filter(e=>!s(e)&&e.visibilityTimeExtent!=null);if(r.length===0&&a.length===0)return i.allTime;let o=[],l=[],u=[];for(let e of r)e.type===`feature`&&h(e)?o.push(e):(e.type===`feature`||e.type===`map-image`)&&e.timeInfo?.hasLiveData?l.push(e):u.push(e);let d=e=>e==null||e.isAllTime,f=[...u.map(e=>{let t=e.timeInfo?.fullTimeExtent,{visibilityTimeExtent:n}=e;return t?.intersection(n)??n}),...a.map(e=>e.visibilityTimeExtent)];if(f.some(d))return i.allTime;let p=l.map(async e=>{let t=(await e.fetchRecomputedExtents({signal:n}))?.timeExtent??e.timeInfo?.fullTimeExtent,{visibilityTimeExtent:r}=e;return t?.intersection(r)??r}),m=(await Promise.allSettled(p)).map(e=>e.status===`fulfilled`?e.value:null);if(m.some(d))return i.allTime;let g=o.map(e=>c(e,n)),_=(await Promise.allSettled(g)).filter(e=>e.status===`fulfilled`).map(e=>e.value),v=[...m,...f,..._].filter(e);return v.length===0?i.allTime:v.reduce((e,t)=>e.union(t))}function p(e,t){let n=e.currentTimeExtent;if(!n)return null;let{start:r,end:a}=n,o=r??a??null;switch(t){case`time-window`:return new i({start:r,end:a});case`cumulative-from-start`:return new i({start:null,end:o});case`cumulative-from-end`:return new i({start:o,end:null});case`instant`:return new i({start:o,end:o})}}async function m(e,t){if(!(a(e)||o(e)))return null;await e.load({signal:t});let n=e?.widgets?.timeSlider;if(!n)return null;let r=await l(e,t),{loop:i}=n,s=u(n);return{fullTimeExtent:r,loop:i,mode:s,playRate:n.stopDelay??2e3,stops:d(n),timeExtent:p(n,s)}}function h(e){if(!e.url)return!1;let t=e.timeInfo,n=e.getAtOrigin(`timeInfo`,`service`);return n?!(!t||t===n||(t.startField===n.startField||!t.startField&&!n.startField)&&(t.endField===n.endField||!t.endField&&!n.endField)):!!t}function g(e){if(!e)return e;let{start:t,end:r}=e;return new i({start:t==null?t:n(t,-t.getTimezoneOffset(),`minutes`),end:r==null?r:n(r,-r.getTimezoneOffset(),`minutes`)})}function _(e){if(!e)return e;let{start:t,end:r}=e;return new i({start:t==null?t:n(t,t.getTimezoneOffset(),`minutes`),end:r==null?r:n(r,r.getTimezoneOffset(),`minutes`)})}export{c as fetchTimeExtent,f as getTimeExtentFromLayers,m as getTimeSliderSettingsFromWebDocument,h as requireFetchTimeExtent,_ as toLocalTimeExtent,g as toUTCTimeExtent};
2
+ import{isSome as e}from"../core/arrayUtils.js";import{clone as t}from"../core/lang.js";import{offsetDate as n}from"../core/timeUtils.js";import r from"../rest/support/StatisticDefinition.js";import i from"../time/TimeExtent.js";import{isWebMap as a}from"../webmap/utils.js";import{isWebScene as o}from"../webscene/utils.js";function s(e){return e.timeInfo!==void 0}async function c(t,n){if(!t.timeInfo||!t.timeInfo.startField&&!t.timeInfo.endField)return null;let{startField:a,endField:o}=t.timeInfo,s=t.createQuery();s.outStatistics=[],a&&s.outStatistics.push(new r({onStatisticField:a,outStatisticFieldName:`minStart`,statisticType:`min`}),new r({onStatisticField:a,outStatisticFieldName:`maxStart`,statisticType:`max`})),o&&s.outStatistics.push(new r({onStatisticField:o,outStatisticFieldName:`minEnd`,statisticType:`min`}),new r({onStatisticField:o,outStatisticFieldName:`maxEnd`,statisticType:`max`}));let{features:c}=await t.queryFeatures(s,{signal:n}),l=c.at(0),u=[l?.getAttribute(`minStart`),l?.getAttribute(`maxStart`),l?.getAttribute(`minEnd`),l?.getAttribute(`maxEnd`)].filter(e).map(e=>typeof e==`string`?Date.parse(e):e);if(!u.length)return null;let d=new Date(Math.min(...u)),f=new Date(Math.max(...u)),p=new i({start:d,end:f}),{visibilityTimeExtent:m}=t;return p?.intersection(m)??m}async function l(e,t){return e.widgets?.timeSlider?.fullTimeExtent??f(e.allLayers,t)}function u(e){let t=e.numThumbs??2,n=e.currentTimeExtent;if(n){let{start:e,end:r}=n;return e!=null&&r!=null&&e.getTime()===r.getTime()?`instant`:t===2?`time-window`:e==null||e.getTime()===0?`cumulative-from-start`:`cumulative-from-end`}return t===2?`time-window`:`cumulative-from-start`}function d(e){let{numStops:n,stopInterval:r,stops:i}=e;return i?{dates:t(i)}:r?{interval:r.clone()}:{count:n??5}}async function f(t,n){if(t.length===0)return i.allTime;await Promise.all(t.map(e=>e.load({signal:n})));let r=t.filter(s),a=t.filter(e=>!s(e)&&e.visibilityTimeExtent!=null);if(r.length===0&&a.length===0)return i.allTime;let o=[],l=[],u=[];for(let e of r)(e.type===`feature`||e.type===`scene`)&&h(e)?o.push(e):(e.type===`feature`||e.type===`map-image`)&&e.timeInfo?.hasLiveData?l.push(e):u.push(e);let d=e=>e==null||e.isAllTime,f=[...u.map(e=>{let t=e.timeInfo?.fullTimeExtent,{visibilityTimeExtent:n}=e;return t?.intersection(n)??n}),...a.map(e=>e.visibilityTimeExtent)];if(f.some(d))return i.allTime;let p=l.map(async e=>{let t=(await e.fetchRecomputedExtents({signal:n}))?.timeExtent??e.timeInfo?.fullTimeExtent,{visibilityTimeExtent:r}=e;return t?.intersection(r)??r}),m=(await Promise.allSettled(p)).map(e=>e.status===`fulfilled`?e.value:null);if(m.some(d))return i.allTime;let g=o.map(e=>c(e,n)),_=(await Promise.allSettled(g)).filter(e=>e.status===`fulfilled`).map(e=>e.value),v=[...m,...f,..._].filter(e);return v.length===0?i.allTime:v.reduce((e,t)=>e.union(t))}function p(e,t){let n=e.currentTimeExtent;if(!n)return null;let{start:r,end:a}=n,o=r??a??null;switch(t){case`time-window`:return new i({start:r,end:a});case`cumulative-from-start`:return new i({start:null,end:o});case`cumulative-from-end`:return new i({start:o,end:null});case`instant`:return new i({start:o,end:o})}}async function m(e,t){if(!(a(e)||o(e)))return null;await e.load({signal:t});let n=e?.widgets?.timeSlider;if(!n)return null;let r=await l(e,t),{loop:i}=n,s=u(n);return{fullTimeExtent:r,loop:i,mode:s,playRate:n.stopDelay??2e3,stops:d(n),timeExtent:p(n,s)}}function h(e){if(!e.url)return!1;let t=e.timeInfo,n=e.getAtOrigin(`timeInfo`,`service`);return n?!(!t||t===n||(t.startField===n.startField||!t.startField&&!n.startField)&&(t.endField===n.endField||!t.endField&&!n.endField)):!!t}function g(e){if(!e)return e;let{start:t,end:r}=e;return new i({start:t==null?t:n(t,-t.getTimezoneOffset(),`minutes`),end:r==null?r:n(r,-r.getTimezoneOffset(),`minutes`)})}function _(e){if(!e)return e;let{start:t,end:r}=e;return new i({start:t==null?t:n(t,t.getTimezoneOffset(),`minutes`),end:r==null?r:n(r,r.getTimezoneOffset(),`minutes`)})}export{c as fetchTimeExtent,f as getTimeExtentFromLayers,m as getTimeSliderSettingsFromWebDocument,h as requireFetchTimeExtent,_ as toLocalTimeExtent,g as toUTCTimeExtent};