[Bf-blender-cvs] [ea72c5d69be] master: GPUShader: Fix wide line emulation with flat color interpolation.

Clément Foucault noreply at git.blender.org
Fri Sep 18 22:41:53 CEST 2020


Commit: ea72c5d69be6fe25f7ed759f024dcbcd5db726cf
Author: Clément Foucault
Date:   Fri Sep 18 22:41:33 2020 +0200
Branches: master
https://developer.blender.org/rBea72c5d69be6fe25f7ed759f024dcbcd5db726cf

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.

===================================================================

M	source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl

===================================================================

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];



More information about the Bf-blender-cvs mailing list