Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-18 23:41:33 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-18 23:41:49 +0300
commitea72c5d69be6fe25f7ed759f024dcbcd5db726cf (patch)
tree68a507fa209fa49249ce77e76ba46c61fec5de6a /source/blender/gpu/shaders
parent649b0ccac8b514b471cdeede97b1a2839c2176b9 (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.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl3
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];