diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-18 23:41:33 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-18 23:41:49 +0300 |
commit | ea72c5d69be6fe25f7ed759f024dcbcd5db726cf (patch) | |
tree | 68a507fa209fa49249ce77e76ba46c61fec5de6a | |
parent | 649b0ccac8b514b471cdeede97b1a2839c2176b9 (diff) |
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.
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl | 3 |
1 files changed, 2 insertions, 1 deletions
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]; |