From 4cb2204d3a28a2e3f42f0460becbe75a00ea73e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 19 Dec 2022 13:14:33 +0100 Subject: [PATCH] Fix T103037: Regression: Grease Pencil Line Texture last point gets distorted This was due to a missing endpoint case that wasn't handled in the port. The last point still have to be discarded manually because of the dot/stroke setting of the material. The first test `ma1.x == -1` is not necessary anymore since the index buffer do not contain this point (which was rendered using instance rendering before. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D16812 --- source/blender/draw/intern/shaders/common_gpencil_lib.glsl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/draw/intern/shaders/common_gpencil_lib.glsl b/source/blender/draw/intern/shaders/common_gpencil_lib.glsl index def841b07aa..5b79ce71739 100644 --- a/source/blender/draw/intern/shaders/common_gpencil_lib.glsl +++ b/source/blender/draw/intern/shaders/common_gpencil_lib.glsl @@ -187,6 +187,13 @@ vec4 gpencil_vertex(vec4 viewport_size, is_squares = false; } + /* Endpoints, we discard the vertices. */ + if (!is_dot && ma2.x == -1) { + /* We set the vertex at the camera origin to generate 0 fragments. */ + out_ndc = vec4(0.0, 0.0, -3e36, 0.0); + return out_ndc; + } + /* Avoid using a vertex attribute for quad positioning. */ float x = float(gl_VertexID & 1) * 2.0 - 1.0; /* [-1..1] */ float y = float(gl_VertexID & 2) - 1.0; /* [-1..1] */