@arcgis/core 5.2.0-next.160 → 5.2.0-next.162

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 (152) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{0a5a9885ee6f5b5f99f0.js → 167b057ad50e6aef54de.js} +1 -1
  4. package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
  5. package/assets/esri/core/workers/chunks/{15bcf7cfe603f2ee1a24.js → 28104681ba161967039f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{842893e75696428d536f.js → 3b0808ee3c4facfaca3d.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{eebbde81e56d69dc602f.js → 44f90e75c1dc3d726a95.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{77ebacfdf8e57f2e03f1.js → 46c5371c7a627537098c.js} +11 -11
  9. package/assets/esri/core/workers/chunks/5daa9429808ca31279f2.js +1 -0
  10. package/assets/esri/core/workers/chunks/{60737732ce495bbdd0fc.js → 5f4feca26102088ea565.js} +1 -1
  11. package/assets/esri/core/workers/chunks/6da7229433105a69eb3f.js +1 -0
  12. package/assets/esri/core/workers/chunks/83f29a159b8b5197e76a.js +1 -0
  13. package/assets/esri/core/workers/chunks/849879c8aed16315194c.js +1 -0
  14. package/assets/esri/core/workers/chunks/{1d77c8c59b0118c7e77b.js → 85bba551057366cd00ae.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{4eae066673484986d4c1.js → 8e4a7027d171fb60e51e.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{32b351b047ce1eb58146.js → 9ce8b9b80da146a5bbf5.js} +1 -1
  18. package/assets/esri/core/workers/chunks/a2fcbc494333376192aa.js +1 -0
  19. package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
  20. package/assets/esri/core/workers/chunks/{f1df76f098a3cc924832.js → b5df193c93e9c19f9700.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{d33360c4f85203edafff.js → bf4d913e523eae2fda28.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{172cfeb5f415e4662432.js → d7429b58c90e015263ad.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
  25. package/assets/esri/core/workers/chunks/{02f8654852d389583891.js → e04fb83ab2634bc15cc7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/f74ae0eff3f08978e607.js +1 -0
  27. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +2 -5
  28. package/assets/esri/themes/dark/main.css +1 -1
  29. package/assets/esri/themes/light/main.css +1 -1
  30. package/assets/esri/themes/light/view.css +1 -1
  31. package/chunks/DefaultMaterial.glsl.js +1 -1
  32. package/chunks/RealisticTree.glsl.js +1 -1
  33. package/chunks/RibbonLine.glsl.js +125 -133
  34. package/config.d.ts +62 -34
  35. package/config.js +1 -1
  36. package/core/has.js +1 -1
  37. package/core/mapCollectionUtils.js +1 -1
  38. package/core/workers/Connection.d.ts +58 -89
  39. package/core/workers.d.ts +45 -54
  40. package/geometry/support/Indices.js +1 -1
  41. package/geometry/support/aaBoundingRect.js +1 -1
  42. package/geometry/support/ray.js +1 -1
  43. package/kernel.js +1 -1
  44. package/layers/FeatureLayer.d.ts +7 -5
  45. package/layers/FeatureLayer.js +1 -1
  46. package/layers/GeospatialPDFLayer.js +1 -1
  47. package/layers/MapImageLayer.d.ts +9 -3
  48. package/layers/MapNotesLayer.d.ts +2 -2
  49. package/layers/SubtypeGroupLayer.d.ts +1 -1
  50. package/layers/SubtypeGroupLayer.js +1 -1
  51. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  52. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  53. package/layers/graphics/sources/support/QueryTask.js +1 -1
  54. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
  55. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  56. package/layers/mixins/ArcGISMapService.js +1 -1
  57. package/layers/ogc/ogcFeatureUtils.js +1 -1
  58. package/layers/support/Sublayer.d.ts +29 -15
  59. package/layers/support/Sublayer.js +1 -1
  60. package/layers/support/commonProperties.js +1 -1
  61. package/package.json +2 -2
  62. package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
  63. package/rest/layerSources/DynamicDataLayer.js +1 -1
  64. package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
  65. package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
  66. package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
  67. package/rest/layerSources/typeUtils.js +2 -0
  68. package/rest/print.js +1 -1
  69. package/rest/query/operations/queryRelatedRecords.js +1 -1
  70. package/rest/query/operations/queryUtils.js +1 -1
  71. package/rest/support/Query.js +1 -1
  72. package/rest/support/RelationshipQuery.js +1 -1
  73. package/symbols/LineSymbol3D.d.ts +5 -3
  74. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
  75. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  76. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  77. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  78. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  79. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  80. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  81. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
  82. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  83. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  84. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  85. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  86. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  87. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  88. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  89. package/views/3d/input/SceneInputManager.js +1 -1
  90. package/views/3d/input/handlers/DragZoom.js +1 -1
  91. package/views/3d/input/handlers/MouseWheelFov.js +1 -1
  92. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  93. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  94. package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
  95. package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
  96. package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
  97. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  98. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  99. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  100. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  101. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  102. package/views/3d/layers/FlowSubView3D.js +1 -1
  103. package/views/3d/layers/I3SMeshView3D.js +1 -1
  104. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  105. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  106. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  107. package/views/3d/layers/graphics/extrudePolygon.js +1 -1
  108. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  109. package/views/3d/state/controllers/FovController.js +1 -1
  110. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  111. package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
  112. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  113. package/views/3d/support/elevationUpdateUtils.js +1 -1
  114. package/views/3d/terrain/PatchRenderData.js +1 -1
  115. package/views/3d/terrain/TerrainData.js +1 -1
  116. package/views/3d/terrain/TextureReference.js +1 -1
  117. package/views/3d/terrain/terrainUtils.js +1 -1
  118. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
  119. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
  120. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
  121. package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
  122. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  123. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  124. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  125. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  126. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  127. package/views/BreakpointsOwner.d.ts +6 -0
  128. package/views/SceneView.js +1 -1
  129. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  130. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  131. package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
  132. package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
  133. package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
  134. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  135. package/views/types.d.ts +3 -0
  136. package/views/webgl/ShaderBuilder.js +1 -1
  137. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  138. package/widgets/Search/LocatorSearchSource.d.ts +22 -1
  139. package/widgets/support/SelectionList/GroupLayerItem.d.ts +2 -0
  140. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  141. package/widgets/support/SelectionList/ItemBase.d.ts +2 -0
  142. package/widgets/support/SelectionList/ItemBase.js +1 -1
  143. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  144. package/widgets/support/SelectionList.js +1 -1
  145. package/assets/esri/core/workers/chunks/3e3e076fa5e8d5d5f33f.js +0 -1
  146. package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
  147. package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +0 -1
  148. package/assets/esri/core/workers/chunks/abb9e820d2871fa7acae.js +0 -1
  149. package/assets/esri/core/workers/chunks/ade5fdcd08dcbac74740.js +0 -1
  150. package/assets/esri/core/workers/chunks/b390b9cde2884755e8be.js +0 -1
  151. package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
  152. package/assets/esri/core/workers/chunks/f4a7aa3cdbc0c429c359.js +0 -1
@@ -43,7 +43,7 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
43
43
  ${M(X,`vColor.rgb *`)} matColor,
44
44
  texColor.rgb,
45
45
  vExternalColor.rgb,
46
- colorMixMode
46
+ int(colorMixMode)
47
47
  );
48
48
  float opacity_ = getDefaultMaterialOpacity(texColor.a);
49
49
 
@@ -34,7 +34,7 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
34
34
  ${O(P.hasVertexColors,`vColor.rgb * `)} matColor,
35
35
  texColor.rgb,
36
36
  vExternalColor.rgb,
37
- colorMixMode
37
+ int(colorMixMode)
38
38
  );
39
39
  float opacity_ = getDefaultMaterialOpacity(texColor.a);
40
40
 
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/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{evaluateSceneLightingFragment as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js";import{LineStipple as r,computePixelSize as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{NormalUtils as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PiUtils as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{positionOutsideClipSpace as c}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{metersPerRenderUnit as l,screenPixelSizePerDistance as u,inverseProjectionMatrix as d,nearFar as f,viewport as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{NoPerspectiveWrite as h,NoPerspectiveRead as g}from"../views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js";import{addProjViewLocalOrigin as _,addPixelRatio as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as y}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as b}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as x}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as S,If as C}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{alphaCutoff as w}from"../views/3d/webgl-engine/shaders/alphaCutoff.glsl.js";import{animatedAlpha as T}from"../views/3d/webgl-engine/shaders/animatedAlpha.glsl.js";import{outputColorHighlightOLID as E}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{getTextureBackedBufferModule as ee}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:K}=O,q=R===2,J=z&&q,Y=B||J,X=z||q,Z=O.usePerspectiveCorrectStipple,Q=ee(O).createBuilder(k,O);M.inputs.add(`position`,()=>Q.getTextureAttribute(`position`)),O.hasVVSize?M.inputs.add(`sizeFeatureAttribute`,()=>Q.getTextureAttribute(`sizeFeatureAttribute`)):M.inputs.add(`size`,()=>Q.getTextureAttribute(`size`)),O.hasVVOpacity&&M.inputs.add(`opacityFeatureAttribute`,()=>Q.getTextureAttribute(`opacityFeatureAttribute`)),O.hasVVColor?M.inputs.add(`colorFeatureAttribute`,()=>Q.getTextureAttribute(`colorFeatureAttribute`)):M.inputs.add(`color`,()=>Q.getTextureAttribute(`color`)),N.include(s),k.include(t,O),k.include(r,O),L===11?(k.varyings.add(`objectAndLayerIdColorVarying`,`vec4`),M.code.add(S`
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{evaluateSceneLightingFragment as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js";import{LineStipple as r,computePixelSize as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{NormalUtils as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PiUtils as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{positionOutsideClipSpace as c}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{metersPerRenderUnit as l,screenPixelSizePerDistance as u,inverseProjectionMatrix as d,nearFar as f,viewport as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as ee}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{NoPerspectiveWrite as m,NoPerspectiveRead as h}from"../views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js";import{addProjViewLocalOrigin as g,addPixelRatio as _}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as y}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as x,If as S}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{alphaCutoff as C}from"../views/3d/webgl-engine/shaders/alphaCutoff.glsl.js";import{animatedAlpha as w}from"../views/3d/webgl-engine/shaders/animatedAlpha.glsl.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 te}from"../views/webgl/ShaderBuilder.js";const D=1;function O(D){let O=new te,{attributes:k,varyings:A,vertex:j,fragment:M}=O,{applyMarkerOffset:N,draped:P,shadingEnabled:F,output:I,capType:L,stippleEnabled:R,falloffEnabled:z,wireframe:B,innerColorEnabled:V,hasAnimation:H,hasScreenSizePerspective:U,worldSized:W,imagePattern:G,useFlatJoinVarying:K}=D,q=L===2,J=R&&q,Y=z||J,X=R||q,Z=D.usePerspectiveCorrectStipple,Q=E(D).createBuilder(O,D);j.inputs.add(`position`,()=>Q.getTextureAttribute(`position`)),D.hasVVSize?j.inputs.add(`sizeFeatureAttribute`,()=>Q.getTextureAttribute(`sizeFeatureAttribute`)):j.inputs.add(`size`,()=>Q.getTextureAttribute(`size`)),D.hasVVOpacity&&j.inputs.add(`opacityFeatureAttribute`,()=>Q.getTextureAttribute(`opacityFeatureAttribute`)),D.hasVVColor?j.inputs.add(`colorFeatureAttribute`,()=>Q.getTextureAttribute(`colorFeatureAttribute`)):j.inputs.add(`color`,()=>Q.getTextureAttribute(`color`)),M.include(s),O.include(t,D),O.include(r,D),I===11?(O.varyings.add(`objectAndLayerIdColorVarying`,`vec4`),j.code.add(x`
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
- `),N.code.add(S`void outputObjectAndLayerIdColor() {
10
+ `),M.code.add(x`void outputObjectAndLayerIdColor() {
11
11
  fragColor = objectAndLayerIdColorVarying;
12
- }`)):(M.code.add(S`void forwardObjectAndLayerIdColor() {}`),N.code.add(S`void outputObjectAndLayerIdColor() {}`));let $=P&&!F;if($&&k.include(a,O),_(M,O),F&&(G||z)){let e=G?`groundMetersToScreenRatio`:`planarDistanceToScreenRatio`;M.uniforms.add(new b(e,e=>1/(e.screenToPlanarDistanceRatio*(G?e.planarDistanceToGroundRatio:1))))}return G&&!F&&M.uniforms.add(l,u),M.uniforms.add(d,f,p,new x(`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(`textureElementIndex`,`uint`),A.add(`lineParameters`,`vec2`),j.add(`vColor`,`vec4`),j.add(`vpos`,`vec3`,{invariant:!0}),j.add(`vLineDistance`,`float`),j.add(`vLineWidth`,`float`),z||(j.add(`vIsInsideJoin`,`int`),j.add(`vStretchFactor`,`float`),j.add(`vJoinCenterLineSDFs`,`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(S`vec3 perpendicular(vec3 v) {
12
+ }`)):(j.code.add(x`void forwardObjectAndLayerIdColor() {}`),M.code.add(x`void outputObjectAndLayerIdColor() {}`));let $=N&&!P;if($&&O.include(a,D),g(j,D),P&&(W||R)){let e=W?`groundMetersToScreenRatio`:`planarDistanceToScreenRatio`;j.uniforms.add(new y(e,e=>1/(e.screenToPlanarDistanceRatio*(W?e.planarDistanceToGroundRatio:1))))}return W&&!P&&j.uniforms.add(l,u),j.uniforms.add(d,f,p,new b(`miterLimit`,e=>e.join===`miter`?e.miterLimit:0)),j.constants.add(`LARGE_HALF_FLOAT`,`float`,65500),j.constants.add(`EPS`,`float`,.001),j.constants.add(`NUM_JOIN_SUBDIVISIONS`,`float`,D.numJoinSubdivisions),k.add(`textureElementIndex`,`uint`),k.add(`lineParameters`,`vec2`),A.add(`vColor`,`vec4`),A.add(`vpos`,`vec3`,{invariant:!0}),A.add(`vLineDistance`,`float`),A.add(`vLineWidth`,`float`),K?A.add(`vIsInsideJoin`,`int`,{flat:!0}):A.add(`vIsInsideJoin`,`float`),A.add(`vStretchFactor`,`float`),A.add(`vJoinCenterLineSDFs`,`vec2`),A.add(`vSubdivisionFactor`,`float`),R&&A.add(`vLineSizeInv`,`float`),Y&&A.add(`vLineDistanceNorm`,`float`),q&&(A.add(`vSegmentSDF`,`float`),A.add(`vReverseSegmentSDF`,`float`)),j.code.add(x`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
- }`),M.code.add(S`vec4 projectAndScale(vec4 pos) {
23
+ }`),j.code.add(x`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
- }`),M.code.add(S`
28
+ }`),j.code.add(x`
29
29
  void clip(
30
30
  inout vec4 pos,
31
31
  inout vec4 prev,
32
32
  inout vec4 next,
33
- ${C(Z,S`inout float u0, inout float prevU0, inout float nextU0,`)}
33
+ ${S(Z,x`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
- ${C(Z,S`u0 = mix(prevU0, u0, clipFactor); nextU0 = u0;`)}
44
+ ${S(Z,x`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
- ${C(Z,S`u0 = mix(u0, nextU0, clipFactor); prevU0 = u0;`)}
54
+ ${S(Z,x`u0 = mix(u0, nextU0, clipFactor); prevU0 = u0;`)}
55
55
  pos = mix(pos, next, clipFactor);
56
56
  prev = pos;
57
57
  } else {
@@ -63,25 +63,25 @@ 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
- ${C(Z,S`prevU0 = mix(u0, prevU0, clipFactor);`)}
66
+ ${S(Z,x`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
- ${C(Z,S`nextU0 = mix(nextU0, u0, clipFactor);`)}
73
+ ${S(Z,x`nextU0 = mix(nextU0, u0, clipFactor);`)}
74
74
  next = mix(next, pos, clipFactor);
75
75
  }
76
76
  }
77
77
  }
78
- `),v(M),M.constants.add(`aaWidth`,`float`,+!z),M.main.add(S`
78
+ `),_(j),j.constants.add(`aaWidth`,`float`,1),M.constants.add(`aaWidth`,`float`,1),j.main.add(x`
79
79
  vec3 position = ${Q.getTextureAttribute(`position`)};
80
80
  float u0 = ${Q.getTextureAttribute(`u0`)};
81
- ${C(G,S`
81
+ ${S(W,x`
82
82
  float prevU0 = ${Q.getTextureAttribute(`u0`,-1)};
83
83
  float nextU0 = ${Q.getTextureAttribute(`u0`,1)};
84
- ${C(!F,S`
84
+ ${S(!P,x`
85
85
  u0 *= metersPerRenderUnit;
86
86
  prevU0 *= metersPerRenderUnit;
87
87
  nextU0 *= metersPerRenderUnit;
@@ -90,13 +90,15 @@ return posNdc;
90
90
 
91
91
  // unpack values from vertex type
92
92
  float vertexType = abs(lineParameters.y);
93
+ ${S(!K,x`
94
+ bool isInsideJoin = vertexType > 8.0;
95
+ vertexType -= isInsideJoin ? 8.0 : 0.0;
96
+ `)}
93
97
  float lineSide = sign(lineParameters.y);
94
98
  bool isStartVertex = vertexType == 2.0 || vertexType == 4.0;
95
99
  vec3 prevPosition = ${Q.getTextureAttribute(`position`,-1)};
96
100
  vec3 nextPosition = ${Q.getTextureAttribute(`position`,1)};
97
101
 
98
- float coverage = 1.0;
99
-
100
102
  // Check for special value of lineParameters.y which is used by the Renderer when graphics are removed before the
101
103
  // VBO is recompacted. If this is the case, then we just project outside of clip space.
102
104
  if (lineParameters.y == 0.0) {
@@ -108,11 +110,11 @@ return posNdc;
108
110
  vec4 next = view * vec4(nextPosition, 1.0);
109
111
 
110
112
  bool isJoin = vertexType < 3.0;
111
- `),$&&M.main.add(S`vec4 other = isStartVertex ? next : prev;
113
+ `),$&&j.main.add(x`vec4 other = isStartVertex ? next : prev;
112
114
  bool markersHidden = areWorldMarkersHidden(pos.xyz, other.xyz);
113
115
  if (!isJoin && !markersHidden) {
114
116
  pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
115
- }`),k.include(h),M.code.add(S`
117
+ }`),O.include(m),j.code.add(x`
116
118
  vec2 computeJoinAndCapDisplacement(
117
119
  bool isJoin,
118
120
  bool isStartVertex,
@@ -157,49 +159,49 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
157
159
  }
158
160
  }
159
161
 
160
- ${C(!z,S`
161
- // Compute stretch compensation for feathering.
162
- if (subdivisionFactor > 0.0) {
163
- vIsInsideJoin = 1;
164
- }
165
- vSubdivisionFactor = isOutside ? subdivisionFactor : 0.5;
166
-
167
- if (miterDisplacementLen > miterLimit * lineWidth) {
168
- vec2 leftScreenDir = left.xy;
169
- vec2 rightScreenDir = right.xy;
170
- float leftScreenLen = length(leftScreenDir);
171
- float rightScreenLen = length(rightScreenDir);
172
-
173
- if (leftScreenLen > EPS && rightScreenLen > EPS) {
174
- leftScreenDir /= leftScreenLen;
175
- rightScreenDir /= rightScreenLen;
176
-
177
- /**
178
- * Feathering AA needs special considerations on join triangles because these can get stretched a lot at acute angles.
179
- * We use the triangle height to determine by how much they get stretched.
180
- */
181
- float theta = acos(clamp(dot(leftScreenDir, rightScreenDir), -1.0, 1.0));
182
- /**
183
- * The argument of cos here is half the angle of a join triangle.
184
- * We start with one triangle, and every subdivision adds another triangle.
185
- */
186
- float subdividedTriangleHeight = (innerDisplacementLen + lineWidth) * cos(theta / (2.0 + 2.0 * NUM_JOIN_SUBDIVISIONS));
187
- float bevelTriangleHeight = innerDisplacementLen + lineWidth * cos(theta * 0.5);
188
- float triangleHeight = NUM_JOIN_SUBDIVISIONS > 0.0 ? subdividedTriangleHeight : bevelTriangleHeight;
189
- vStretchFactor = noPerspectiveWrite(max(triangleHeight / (2.0 * lineWidth), 1.0), perspectiveDivisor);
190
- }
191
- }
192
- `)}
162
+ // Compute stretch compensation for feathering.
163
+ ${S(K,x`
164
+ if (subdivisionFactor > 0.0) {
165
+ vIsInsideJoin = 1;
166
+ }
167
+ `)}
168
+ vSubdivisionFactor = isOutside ? subdivisionFactor : 0.5;
169
+
170
+ if (miterDisplacementLen > miterLimit * lineWidth) {
171
+ vec2 leftScreenDir = left.xy;
172
+ vec2 rightScreenDir = right.xy;
173
+ float leftScreenLen = length(leftScreenDir);
174
+ float rightScreenLen = length(rightScreenDir);
175
+
176
+ if (leftScreenLen > EPS && rightScreenLen > EPS) {
177
+ leftScreenDir /= leftScreenLen;
178
+ rightScreenDir /= rightScreenLen;
179
+
180
+ /**
181
+ * Feathering AA needs special considerations on join triangles because these can get stretched a lot at acute angles.
182
+ * We use the triangle height to determine by how much they get stretched.
183
+ */
184
+ float theta = acos(clamp(dot(leftScreenDir, rightScreenDir), -1.0, 1.0));
185
+ /**
186
+ * The argument of cos here is half the angle of a join triangle.
187
+ * We start with one triangle, and every subdivision adds another triangle.
188
+ */
189
+ float subdividedTriangleHeight = (innerDisplacementLen + lineWidth) * cos(theta / (2.0 + 2.0 * NUM_JOIN_SUBDIVISIONS));
190
+ float bevelTriangleHeight = innerDisplacementLen + lineWidth * cos(theta * 0.5);
191
+ float triangleHeight = NUM_JOIN_SUBDIVISIONS > 0.0 ? subdividedTriangleHeight : bevelTriangleHeight;
192
+ vStretchFactor = noPerspectiveWrite(max(triangleHeight / (2.0 * lineWidth), 1.0), perspectiveDivisor);
193
+ }
194
+ }
193
195
 
194
196
  if (isOutside && displacementLen > miterLimit * lineWidth) {
195
- ${C(O.roundJoins,S`
197
+ ${S(D.roundJoins,x`
196
198
  vec3 startDir = perpendicular(leftLen < EPS ? right : left);
197
199
  vec3 endDir = perpendicular(rightLen < EPS ? left : right);
198
- float factor = ${z?S`min(1.0, subdivisionFactor * ((NUM_JOIN_SUBDIVISIONS + 1.0) / NUM_JOIN_SUBDIVISIONS))`:S`subdivisionFactor`};
200
+ float factor = ${R?x`min(1.0, subdivisionFactor * ((NUM_JOIN_SUBDIVISIONS + 1.0) / NUM_JOIN_SUBDIVISIONS))`:x`subdivisionFactor`};
199
201
 
200
202
  float rotationAngle = acos(clamp(dot(startDir.xy, endDir.xy), -1.0, 1.0));
201
203
  joinDisplacementDir = rotateZ(startDir, -lineSide * factor * rotationAngle);
202
- `,S`
204
+ `,x`
203
205
  /**
204
206
  * Convert to bevel join if miterLimit is exceeded.
205
207
  * Here vertices with a subdivisionFactor > 0 are either START vertices or
@@ -211,19 +213,19 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
211
213
  vec3 startDir = perpendicular(leftLen < EPS ? right : left);
212
214
  vec3 endDir = perpendicular(rightLen < EPS ? left : right);
213
215
 
214
- ${C(z,S`joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? endDir : startDir;`,S`joinDisplacementDir = mix(startDir, endDir, subdivisionFactor);`)}
216
+ ${S(R,x`joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? endDir : startDir;`,x`joinDisplacementDir = mix(startDir, endDir, subdivisionFactor);`)}
215
217
  `)}
216
218
  displacementLen = lineWidth;
217
219
  }
218
220
  } else {
219
221
  joinDisplacementDir = perpendicular(isStartVertex ? right : left);
220
- ${R===0?``:S`capDisplacementDir = vec3((isStartVertex ? -right : left).xy, 0.0);`}
222
+ ${L===0?``:x`capDisplacementDir = vec3((isStartVertex ? -right : left).xy, 0.0);`}
221
223
  }
222
224
 
223
225
  return (joinDisplacementDir.xy * lineSide + capDisplacementDir.xy) * displacementLen;
224
226
  }
225
- `),M.main.add(S`
226
- clip(pos, prev, next, ${C(Z,S`u0, prevU0, nextU0,`)} isStartVertex);
227
+ `),j.main.add(x`
228
+ clip(pos, prev, next, ${S(Z,x`u0, prevU0, nextU0,`)} isStartVertex);
227
229
 
228
230
  vec3 clippedPos = pos.xyz;
229
231
  vec3 clippedCenter = mix(pos.xyz, isStartVertex ? next.xyz : prev.xyz, 0.5);
@@ -235,46 +237,32 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
235
237
  vec3 left = (pos.xyz - prev.xyz);
236
238
  vec3 right = (next.xyz - pos.xyz);
237
239
 
238
- float lineSize = getSize(${C(W,`clippedPos`)});
239
- ${C(z&&W,`float patternLineSize = getSize(clippedCenter);`)}
240
- ${C(z&&!W,`float patternLineSize = lineSize;`)}
240
+ float lineSize = getSize(${S(U,`clippedPos`)});
241
+ ${S(R&&U,`float patternLineSize = getSize(clippedCenter);`)}
242
+ ${S(R&&!U,`float patternLineSize = lineSize;`)}
241
243
 
242
- ${C(G,S`
243
- ${C(F,S`float lineSizeScreen = lineSize * groundMetersToScreenRatio;`,S`
244
+ ${S(W,x`
245
+ ${S(P,x`float lineSizeScreen = lineSize * groundMetersToScreenRatio;`,x`
244
246
  float metersPerScreenPixel = max(-clippedPos.z, nearFar[0]) * metersPerRenderUnit * screenPixelSizePerDistance;
245
247
  float lineSizeScreen = lineSize / metersPerScreenPixel;
246
248
  `)}
247
- if (lineSizeScreen < 1.0) {
248
- coverage = lineSizeScreen;
249
- lineSizeScreen = 1.0;
250
- }
251
-
252
- lineSizeScreen += aaWidth;
253
- float lineWidth = lineSizeScreen * pixelRatio;
254
- `,S`
255
- if (lineSize < 1.0) {
256
- coverage = lineSize; // convert sub-pixel coverage to alpha
257
- lineSize = 1.0;
258
- }
259
-
260
- lineSize += aaWidth;
261
- float lineWidth = lineSize * pixelRatio;
249
+ float lineWidth = lineSizeScreen * pixelRatio + aaWidth;
250
+ `,x`
251
+ float lineWidth = lineSize * pixelRatio + aaWidth;
262
252
  `)}
263
253
 
264
254
  vLineWidth = noPerspectiveWrite(lineWidth, pos.w);
265
- ${z?S`vLineSizeInv = noPerspectiveWrite(1.0 / lineSize, pos.w);`:``}
266
- `),X&&M.main.add(S`
255
+ ${R?x`vLineSizeInv = noPerspectiveWrite(1.0 / ${W?`lineSize`:`max(lineSize, 1.0)`}, pos.w);`:``}
256
+ `),X&&j.main.add(x`
267
257
  float isEndVertex = float(!isStartVertex);
268
258
  vec3 segmentOrigin = mix(pos.xyz, prev.xyz, isEndVertex);
269
259
  vec3 segment = mix(right, left, isEndVertex);
270
- ${q?S`vec3 segmentEnd = mix(next.xyz, pos.xyz, isEndVertex);`:``}
271
- `),M.main.add(S`
272
- ${C(!z,S`
273
- vIsInsideJoin = 0;
274
- vStretchFactor = 1.0;
275
- vSubdivisionFactor = 0.0;
276
- vJoinCenterLineSDFs = vec2(LARGE_HALF_FLOAT);
277
- `)}
260
+ ${q?x`vec3 segmentEnd = mix(next.xyz, pos.xyz, isEndVertex);`:``}
261
+ `),j.main.add(x`
262
+ vIsInsideJoin = ${K?x`0`:x`float(isInsideJoin)`};
263
+ vStretchFactor = 1.0;
264
+ vSubdivisionFactor = 0.0;
265
+ vJoinCenterLineSDFs = vec2(LARGE_HALF_FLOAT);
278
266
 
279
267
  vec2 displacementXY = computeJoinAndCapDisplacement(
280
268
  isJoin,
@@ -300,10 +288,10 @@ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
300
288
  float lineDistNorm = noPerspectiveWrite(lineSide, pos.w);
301
289
 
302
290
  vLineDistance = lineWidth * lineDistNorm;
303
- ${Y?S`vLineDistanceNorm = lineDistNorm;`:``}
291
+ ${Y?x`vLineDistanceNorm = lineDistNorm;`:``}
304
292
 
305
293
  pos.xyz += displacement;
306
- `),z||M.main.add(S`if (isJoin) {
294
+ `),j.main.add(x`if (isJoin) {
307
295
  vec2 joinCenterToVertex = displacementXY;
308
296
  vec2 leftCenterlineDir = left.xy;
309
297
  vec2 rightCenterlineDir = right.xy;
@@ -318,36 +306,36 @@ dot(vec2(leftCenterlineDir.y, -leftCenterlineDir.x), joinCenterToVertex)
318
306
  ),
319
307
  pos.w
320
308
  );
321
- }`),q&&M.main.add(S`vec2 segmentDir = normalize(segment.xy);
309
+ }`),q&&j.main.add(x`vec2 segmentDir = normalize(segment.xy);
322
310
  vSegmentSDF = noPerspectiveWrite((isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin.xy, segmentDir)), pos.w);
323
- vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd.xy, -segmentDir)), pos.w);`),z&&(F?M.main.add(S`float stippleDistanceToScreenRatio = ${G?`groundMetersToScreenRatio`:`planarDistanceToScreenRatio`};`):M.main.add(S`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
324
- float stippleDistanceToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),M.main.add(S`
311
+ vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd.xy, -segmentDir)), pos.w);`),R&&(P?j.main.add(x`float stippleDistanceToScreenRatio = ${W?`groundMetersToScreenRatio`:`planarDistanceToScreenRatio`};`):j.main.add(x`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
312
+ float stippleDistanceToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),j.main.add(x`
325
313
  float segmentLengthScreenDouble = length(segment.xy);
326
314
  float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
327
315
  float discreteStippleDistanceToScreenRatio = discretizeStippleDistanceToScreenRatio(stippleDistanceToScreenRatio);
328
- float segmentLengthRender = ${C(G,S`abs(mix(nextU0 - u0, u0 - prevU0, isEndVertex))`,S`length(mix(nextPosition - position, position - prevPosition, isEndVertex))`)};
316
+ float segmentLengthRender = ${S(W,x`abs(mix(nextU0 - u0, u0 - prevU0, isEndVertex))`,x`length(mix(nextPosition - position, position - prevPosition, isEndVertex))`)};
329
317
 
330
- ${C(!F||G,S`
331
- float segmentStartRender = ${C(G,S`mix(u0, prevU0, isEndVertex)`,S`mix(u0, u0 - segmentLengthRender, isEndVertex)`)};
318
+ ${S(!P||W,x`
319
+ float segmentStartRender = ${S(W,x`mix(u0, prevU0, isEndVertex)`,x`mix(u0, u0 - segmentLengthRender, isEndVertex)`)};
332
320
  `)}
333
321
 
334
322
  vStipplePatternStretch = stippleDistanceToScreenRatio / discreteStippleDistanceToScreenRatio;
335
- `),F?M.main.add(S`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteStippleDistanceToScreenRatio / stippleDistanceToScreenRatio;
336
- float startPseudoScreen = u0 * discreteStippleDistanceToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):M.main.add(S`float startPseudoScreen = segmentStartRender * discreteStippleDistanceToScreenRatio;
337
- float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceToScreenRatio;`),M.uniforms.add(new x(`stipplePatternPixelSize`,e=>i(e))),M.main.add(S`
323
+ `),P?j.main.add(x`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteStippleDistanceToScreenRatio / stippleDistanceToScreenRatio;
324
+ float startPseudoScreen = u0 * discreteStippleDistanceToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):j.main.add(x`float startPseudoScreen = segmentStartRender * discreteStippleDistanceToScreenRatio;
325
+ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceToScreenRatio;`),j.uniforms.add(new b(`stipplePatternPixelSize`,e=>i(e))),j.main.add(x`
338
326
  float patternLength = patternLineSize * stipplePatternPixelSize;
339
327
  vec2 stippleDistanceLimits;
340
328
 
341
- ${C(G,S`
329
+ ${S(W,x`
342
330
  stippleDistanceLimits = vec2(segmentStartRender, segmentStartRender + segmentLengthRender);
343
331
  vStipplePatternStretch = 1.0;
344
332
 
345
- ${C(K,S`
333
+ ${S(G,x`
346
334
  // The v-coordinate used in case of an image pattern.
347
335
  bool isLeft = lineSide < 0.0;
348
336
  vStippleV = isLeft ? 0.0 : 1.0;
349
337
  `)}
350
- `,S`
338
+ `,x`
351
339
  // Compute the coordinates at both start and end of the line segment, because we need both to clamp to in the
352
340
  // fragment shader
353
341
  stippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
@@ -367,7 +355,7 @@ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceT
367
355
  vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (stippleDistanceLimits.y - stippleDistanceLimits.x);
368
356
  }
369
357
 
370
- ${C(Z,S`
358
+ ${S(Z,x`
371
359
  float segmentStartInverseW = 1.0 / mix(pos.w, prev.w, isEndVertex);
372
360
  float segmentEndInverseW = 1.0 / mix(next.w, pos.w, isEndVertex);
373
361
  vStipplePerspective = noPerspectiveWrite(
@@ -383,55 +371,59 @@ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceT
383
371
  // Disable stipple distance limits on caps
384
372
  vStippleLimitsAndCaps.zw = isJoin ? vec2(0.0) :
385
373
  isStartVertex ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
386
- `)),M.main.add(S`
374
+ `)),j.main.add(x`
387
375
  // Convert back into NDC
388
376
  pos.xy = (pos.xy / viewport.zw) * pos.w;
389
377
  pos.z = pos.z * pos.w;
390
378
 
391
379
  vColor = getColor();
392
- vColor.a = noPerspectiveWrite(vColor.a * coverage, pos.w);
380
+ vColor.a = noPerspectiveWrite(vColor.a, pos.w);
393
381
 
394
- ${V&&!F?`pos.z -= EPS * pos.w;`:``}
382
+ ${B&&!P?`pos.z -= EPS * pos.w;`:``}
395
383
 
396
384
  // transform final position to camera space for slicing
397
385
  vpos = (inverseProjectionMatrix * pos).xyz;
398
386
  gl_Position = pos;
399
387
  forwardObjectAndLayerIdColor();
400
- }`),k.include(E,O),k.include(g),N.include(m),N.include(w),N.include(e,O),N.main.add(`discardBySlice(vpos);`),z||N.code.add(S`float lineFeatheringFactor(float lineWidth, float lineDistance) {
401
- float stretchFactor = vIsInsideJoin == 1 ? noPerspectiveRead(vStretchFactor) : 1.0;
388
+ }`),O.include(T,D),O.include(h),M.include(ee),M.include(C),M.include(e,D),M.main.add(`discardBySlice(vpos);`),M.code.add(x`float lineFeatheringFactor(float lineWidth, float lineDistance) {
389
+ float stretchFactor = float(vIsInsideJoin) > 0.5 ? noPerspectiveRead(vStretchFactor) : 1.0;
402
390
  float featherWidth = 2.0;
403
- float featherStartDistance = max(lineWidth - featherWidth / stretchFactor, 0.0);
404
- float straightFeatherStartDistance = max(lineWidth - featherWidth, 0.0);
391
+ float featherStartDistance = lineWidth - featherWidth / stretchFactor;
392
+ float straightFeatherStartDistance = lineWidth - featherWidth;
405
393
  float value = abs(lineDistance);
406
394
  float feather = (value - featherStartDistance) / (lineWidth - featherStartDistance);
407
395
  vec2 joinCenterSDFs = noPerspectiveRead(vJoinCenterLineSDFs);
408
396
  float joinCenterDistance = abs(vSubdivisionFactor > 0.5 ? joinCenterSDFs.x : joinCenterSDFs.y);
409
397
  float straightFeather = (joinCenterDistance - straightFeatherStartDistance) / (lineWidth - straightFeatherStartDistance);
410
- feather = vIsInsideJoin == 1 ? max(feather, straightFeather) : feather;
411
- return 1.0 - clamp(feather, 0.0, 1.0);
412
- }`),N.main.add(S`
398
+ feather = float(vIsInsideJoin) > 0.5 ? max(feather, straightFeather) : feather;
399
+ float coverage = min(lineWidth - aaWidth, 1.0);
400
+ return clamp(1.0 - feather, 0.0, coverage);
401
+ }`),M.main.add(x`
413
402
  float lineWidth = noPerspectiveRead(vLineWidth);
414
403
  float lineDistance = noPerspectiveRead(vLineDistance);
415
- ${C(Y,S`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
416
- `),V?N.main.add(S`vec4 albedo = vec4(1.0, 0.0, 1.0, 1.0);
417
- vec4 finalColor = albedo;`):(q&&N.main.add(S`float sdf = noPerspectiveRead(min(vSegmentSDF, vReverseSegmentSDF));
418
- vec2 fragmentPosition = vec2(min(sdf, 0.0), lineDistance);
419
- float fragmentRadius = length(fragmentPosition);
420
- float fragmentCapSDF = (fragmentRadius - lineWidth) * 0.5;
421
- float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
422
- if (capCoverage < alphaCutoff) {
423
- discard;
424
- }`),J?N.main.add(S`
425
- vec2 stipplePosition = vec2(
426
- min(getStippleCapDistance(), 0.0),
427
- ${Z?S`lineDistance / lineWidth`:S`lineDistanceNorm`}
428
- );
429
- float stippleRadius = length(stipplePosition * lineWidth);
430
- float stippleCapSDF = (stippleRadius - lineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
431
- float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
432
- float stippleAlpha = step(alphaCutoff, stippleCoverage);
433
- `):N.main.add(S`float stippleAlpha = getStippleAlpha(lineWidth);`),L!==11&&N.main.add(S`discardByStippleAlpha(stippleAlpha, alphaCutoff);`),N.uniforms.add(new y(`intrinsicColor`,e=>e.color)).main.add(S`vec4 color = intrinsicColor * vColor;
434
- color.a = noPerspectiveRead(color.a);`),H&&N.uniforms.add(new y(`innerColor`,e=>e.innerColor??e.color),new x(`innerWidth`,(e,t)=>e.innerWidth*t.camera.pixelRatio)).main.add(S`float distToInner = abs(lineDistance) - innerWidth;
404
+ ${S(Y,x`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
405
+ `),J&&M.main.add(x`float nominalLineWidth = lineWidth - aaWidth;`),B?M.main.add(x`vec4 albedo = vec4(1.0, 0.0, 1.0, 1.0);
406
+ vec4 finalColor = albedo;`):(q&&M.main.add(x`
407
+ float sdf = noPerspectiveRead(min(vSegmentSDF, vReverseSegmentSDF));
408
+ vec2 fragmentPosition = vec2(min(sdf, 0.0), lineDistance);
409
+
410
+ float fragmentRadius = length(fragmentPosition);
411
+ float fragmentCapSDF = (fragmentRadius - ${J?`nominalLineWidth`:`lineWidth`}) * 0.5; // Divide by 2 to transform from double pixel scale
412
+ float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
413
+
414
+ if (capCoverage < alphaCutoff) {
415
+ discard;
416
+ }
417
+ `),J?M.main.add(x`vec2 stipplePosition = vec2(
418
+ min(getStippleCapDistance(), 0.0) * nominalLineWidth,
419
+ lineDistance
420
+ );
421
+ float stippleRadius = length(stipplePosition);
422
+ float stippleCapSDF = (stippleRadius - nominalLineWidth) * 0.5;
423
+ float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
424
+ float lineCoverage = min(lineFeatheringFactor(lineWidth, lineDistance), capCoverage);
425
+ float stippleAlpha = lineCoverage > 0.0 ? min(stippleCoverage, lineCoverage) / lineCoverage : 0.0;`):M.main.add(x`float stippleAlpha = getStippleAlpha(lineWidth);`),I!==11&&M.main.add(x`discardByStippleAlpha(stippleAlpha, alphaCutoff);`),M.uniforms.add(new v(`intrinsicColor`,e=>e.color)).main.add(x`vec4 color = intrinsicColor * vColor;
426
+ color.a = noPerspectiveRead(color.a);`),V&&M.uniforms.add(new v(`innerColor`,e=>e.innerColor??e.color),new b(`innerWidth`,(e,t)=>e.innerWidth*t.camera.pixelRatio)).main.add(x`float distToInner = abs(lineDistance) - innerWidth;
435
427
  float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
436
428
  float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
437
- color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),N.main.add(`vec4 albedo = blendStipple(color, stippleAlpha);`),B&&(N.uniforms.add(new x(`falloff`,e=>e.falloff)),N.main.add(S`albedo.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),z||N.main.add(S`albedo.a *= lineFeatheringFactor(lineWidth, lineDistance);`),U&&(M.main.add(`vec4 animatedAlphaTimeStamps = ${Q.getTextureAttribute(`timeStamps`)};`),k.include(T,O),N.main.add(`albedo.a *= animatedAlpha();`)),I?(j.add(`vnormal`,`vec3`),M.include(o,O),M.main.add(`vnormal = getLocalUp(vpos, localOrigin);`),k.include(n,O),N.main.add(`vec4 finalColor = evaluateSceneLightingFragment(vpos, vnormal, albedo);`)):N.main.add(`vec4 finalColor = albedo;`)),N.main.add(S`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};
429
+ color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),M.main.add(`vec4 albedo = blendStipple(color, stippleAlpha);`),z&&(M.uniforms.add(new b(`falloff`,e=>e.falloff)),M.main.add(x`albedo.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),M.main.add(x`albedo.a *= ${J?`lineCoverage`:`lineFeatheringFactor(lineWidth, lineDistance)`};`),H&&(j.main.add(`vec4 animatedAlphaTimeStamps = ${Q.getTextureAttribute(`timeStamps`)};`),O.include(w,D),M.main.add(`albedo.a *= animatedAlpha();`)),F?(A.add(`vnormal`,`vec3`),j.include(o,D),j.main.add(`vnormal = getLocalUp(vpos, localOrigin);`),O.include(n,D),M.main.add(`vec4 finalColor = evaluateSceneLightingFragment(vpos, vnormal, albedo);`)):M.main.add(`vec4 finalColor = albedo;`)),M.main.add(x`outputColorHighlightOLID(applySlice(finalColor, vpos), albedo.rgb);`),O}const k=Object.freeze(Object.defineProperty({__proto__:null,build:O,numRoundJoinSubdivisions:1},Symbol.toStringTag,{value:`Module`}));export{k as R,O as b,D as n};