@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.
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0a5a9885ee6f5b5f99f0.js → 167b057ad50e6aef54de.js} +1 -1
- package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
- package/assets/esri/core/workers/chunks/{15bcf7cfe603f2ee1a24.js → 28104681ba161967039f.js} +1 -1
- package/assets/esri/core/workers/chunks/{842893e75696428d536f.js → 3b0808ee3c4facfaca3d.js} +1 -1
- package/assets/esri/core/workers/chunks/{eebbde81e56d69dc602f.js → 44f90e75c1dc3d726a95.js} +1 -1
- package/assets/esri/core/workers/chunks/{77ebacfdf8e57f2e03f1.js → 46c5371c7a627537098c.js} +11 -11
- package/assets/esri/core/workers/chunks/5daa9429808ca31279f2.js +1 -0
- package/assets/esri/core/workers/chunks/{60737732ce495bbdd0fc.js → 5f4feca26102088ea565.js} +1 -1
- package/assets/esri/core/workers/chunks/6da7229433105a69eb3f.js +1 -0
- package/assets/esri/core/workers/chunks/83f29a159b8b5197e76a.js +1 -0
- package/assets/esri/core/workers/chunks/849879c8aed16315194c.js +1 -0
- package/assets/esri/core/workers/chunks/{1d77c8c59b0118c7e77b.js → 85bba551057366cd00ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{4eae066673484986d4c1.js → 8e4a7027d171fb60e51e.js} +1 -1
- package/assets/esri/core/workers/chunks/{32b351b047ce1eb58146.js → 9ce8b9b80da146a5bbf5.js} +1 -1
- package/assets/esri/core/workers/chunks/a2fcbc494333376192aa.js +1 -0
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
- package/assets/esri/core/workers/chunks/{f1df76f098a3cc924832.js → b5df193c93e9c19f9700.js} +1 -1
- package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
- package/assets/esri/core/workers/chunks/{d33360c4f85203edafff.js → bf4d913e523eae2fda28.js} +1 -1
- package/assets/esri/core/workers/chunks/{172cfeb5f415e4662432.js → d7429b58c90e015263ad.js} +1 -1
- package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
- package/assets/esri/core/workers/chunks/{02f8654852d389583891.js → e04fb83ab2634bc15cc7.js} +1 -1
- package/assets/esri/core/workers/chunks/f74ae0eff3f08978e607.js +1 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +2 -5
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +125 -133
- package/config.d.ts +62 -34
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/workers/Connection.d.ts +58 -89
- package/core/workers.d.ts +45 -54
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +7 -5
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +9 -3
- package/layers/MapNotesLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/support/Sublayer.d.ts +29 -15
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/package.json +2 -2
- package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
- package/rest/layerSources/DynamicDataLayer.js +1 -1
- package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
- package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
- package/rest/layerSources/typeUtils.js +2 -0
- package/rest/print.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/symbols/LineSymbol3D.d.ts +5 -3
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/DragZoom.js +1 -1
- package/views/3d/input/handlers/MouseWheelFov.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
- package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
- package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/extrudePolygon.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/BreakpointsOwner.d.ts +6 -0
- package/views/SceneView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
- package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/types.d.ts +3 -0
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Search/LocatorSearchSource.d.ts +22 -1
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +2 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.d.ts +2 -0
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/3e3e076fa5e8d5d5f33f.js +0 -1
- package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
- package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +0 -1
- package/assets/esri/core/workers/chunks/abb9e820d2871fa7acae.js +0 -1
- package/assets/esri/core/workers/chunks/ade5fdcd08dcbac74740.js +0 -1
- package/assets/esri/core/workers/chunks/b390b9cde2884755e8be.js +0 -1
- package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
- 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
|
|
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
|
-
`),
|
|
10
|
+
`),M.code.add(x`void outputObjectAndLayerIdColor() {
|
|
11
11
|
fragColor = objectAndLayerIdColorVarying;
|
|
12
|
-
}`)):(
|
|
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
|
-
}`),
|
|
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
|
-
}`),
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
73
|
+
${S(Z,x`nextU0 = mix(nextU0, u0, clipFactor);`)}
|
|
74
74
|
next = mix(next, pos, clipFactor);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
`),
|
|
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
|
-
${
|
|
81
|
+
${S(W,x`
|
|
82
82
|
float prevU0 = ${Q.getTextureAttribute(`u0`,-1)};
|
|
83
83
|
float nextU0 = ${Q.getTextureAttribute(`u0`,1)};
|
|
84
|
-
${
|
|
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
|
-
`),$&&
|
|
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
|
-
}`),
|
|
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
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
${
|
|
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 = ${
|
|
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
|
-
`,
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
`),
|
|
226
|
-
clip(pos, prev, next, ${
|
|
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(${
|
|
239
|
-
${
|
|
240
|
-
${
|
|
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
|
-
${
|
|
243
|
-
${
|
|
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
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
${
|
|
266
|
-
`),X&&
|
|
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?
|
|
271
|
-
`),
|
|
272
|
-
${
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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?
|
|
291
|
+
${Y?x`vLineDistanceNorm = lineDistNorm;`:``}
|
|
304
292
|
|
|
305
293
|
pos.xyz += displacement;
|
|
306
|
-
`),
|
|
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&&
|
|
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);`),
|
|
324
|
-
float stippleDistanceToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),
|
|
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 = ${
|
|
316
|
+
float segmentLengthRender = ${S(W,x`abs(mix(nextU0 - u0, u0 - prevU0, isEndVertex))`,x`length(mix(nextPosition - position, position - prevPosition, isEndVertex))`)};
|
|
329
317
|
|
|
330
|
-
${
|
|
331
|
-
float segmentStartRender = ${
|
|
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
|
-
`),
|
|
336
|
-
float startPseudoScreen = u0 * discreteStippleDistanceToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):
|
|
337
|
-
float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceToScreenRatio;`),
|
|
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
|
-
${
|
|
329
|
+
${S(W,x`
|
|
342
330
|
stippleDistanceLimits = vec2(segmentStartRender, segmentStartRender + segmentLengthRender);
|
|
343
331
|
vStipplePatternStretch = 1.0;
|
|
344
332
|
|
|
345
|
-
${
|
|
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
|
-
`,
|
|
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
|
-
${
|
|
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
|
-
`)),
|
|
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
|
|
380
|
+
vColor.a = noPerspectiveWrite(vColor.a, pos.w);
|
|
393
381
|
|
|
394
|
-
${
|
|
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
|
-
}`),
|
|
401
|
-
float stretchFactor = vIsInsideJoin
|
|
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 =
|
|
404
|
-
float straightFeatherStartDistance =
|
|
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
|
|
411
|
-
|
|
412
|
-
|
|
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
|
-
${
|
|
416
|
-
`),
|
|
417
|
-
vec4 finalColor = albedo;`):(q&&
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
float
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
)
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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);`),
|
|
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};
|