From 0d66981ac770f9ec3cc9af624b6899682f5f88b4 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Fri, 20 Jan 2023 21:38:28 -0800 Subject: [PATCH] Fix issue with variable stroke width --- manimlib/shaders/quadratic_bezier_stroke/geom.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manimlib/shaders/quadratic_bezier_stroke/geom.glsl b/manimlib/shaders/quadratic_bezier_stroke/geom.glsl index 598b7948..8e6570f2 100644 --- a/manimlib/shaders/quadratic_bezier_stroke/geom.glsl +++ b/manimlib/shaders/quadratic_bezier_stroke/geom.glsl @@ -188,6 +188,7 @@ void main() { get_corners(p0, p1, p2, v01, v12, scaled_aaw, corners); // Emit each corner + float max_sw = max(v_stroke_width[0], v_stroke_width[2]); for(int i = 0; i < 6; i++){ float stroke_width = v_stroke_width[i / 2]; @@ -195,7 +196,7 @@ void main() { float sign = vec2(-1, 1)[i % 2]; // In this case, we only really care about // the v coordinate - uv_coords = vec2(0, sign * (0.5 * stroke_width + scaled_aaw)); + uv_coords = vec2(0, sign * (0.5 * max_sw + scaled_aaw)); uv_anti_alias_width = scaled_aaw; uv_stroke_width = stroke_width; }else{