From ea72c5d69be6fe25f7ed759f024dcbcd5db726cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 18 Sep 2020 22:41:33 +0200 Subject: [PATCH] GPUShader: Fix wide line emulation with flat color interpolation. This was causing flashing colors in the node editor grid. This is because in some cases the flat color is only set on the provoking vertex which is the last of the primitive by default. --- source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl index b28205b349e..cca94680284 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl @@ -26,7 +26,8 @@ void do_vertex(const int i, vec2 ofs) finalColor = color; #elif defined(FLAT) - finalColor = finalColor_g[0]; + /* WATCH: Assuming last provoking vertex. */ + finalColor = finalColor_g[1]; #elif defined(SMOOTH) finalColor = finalColor_g[i];