From 35b891a69ce0881ce5d2e5aa88d8572b3fb3ec03 Mon Sep 17 00:00:00 2001 From: Tim Deubler Date: Tue, 21 Nov 2023 16:19:18 +0100 Subject: [PATCH] improved(display): The anti-aliasing for lines using floating point widths has been enhanced. Signed-off-by: Tim Deubler --- packages/display/src/displays/webgl/buffer/FeatureFactory.ts | 2 +- packages/display/src/displays/webgl/glsl/line_vertex.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/display/src/displays/webgl/buffer/FeatureFactory.ts b/packages/display/src/displays/webgl/buffer/FeatureFactory.ts index 4471560cf..9395b9a4e 100644 --- a/packages/display/src/displays/webgl/buffer/FeatureFactory.ts +++ b/packages/display/src/displays/webgl/buffer/FeatureFactory.ts @@ -520,7 +520,7 @@ export class FeatureFactory { } else if (type == 'Line') { if (!stroke || !strokeWidth) continue; - const [value, unit] = parseSizeValue(strokeWidth); + const [value, unit] = parseSizeValue(strokeWidth, false); strokeWidth = value; sizeUnit = unit; diff --git a/packages/display/src/displays/webgl/glsl/line_vertex.glsl b/packages/display/src/displays/webgl/glsl/line_vertex.glsl index b3a0027d4..b2dcbe810 100644 --- a/packages/display/src/displays/webgl/glsl/line_vertex.glsl +++ b/packages/display/src/displays/webgl/glsl/line_vertex.glsl @@ -34,7 +34,7 @@ void main(void){ : strokeWidth < 1. ? .65 : 1.; float width = (strokeWidth+alias) / u_scale; - v_width = vec2(strokeWidth, alias * .5); + v_width = vec2(strokeWidth, alias /* *.5 */); // LSB is direction/normal vector [-1,+1] vec2 dir2 = mod(a_normal.zw, 2.0) * 2.0 - 1.0; vec2 aliasNormal = floor(a_normal.zw * .5) * N_SCALE;