[Bf-blender-cvs] [0d2d79b8dfc] greasepencil-object: GPencil: Make Vertex Color works in Vertex Mode

Antonio Vazquez noreply at git.blender.org
Thu Nov 28 19:52:14 CET 2019


Commit: 0d2d79b8dfc099fb57dc3f4577bc00ede836d72a
Author: Antonio Vazquez
Date:   Thu Nov 28 19:48:55 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB0d2d79b8dfc099fb57dc3f4577bc00ede836d72a

GPencil: Make Vertex Color works in Vertex Mode

WIP: Need to disable Vertex Color in Material mode

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

M	source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
M	source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl
M	source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl

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

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
index 0c290260b20..8285541e0b4 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
@@ -51,6 +51,7 @@ uniform float fade_ob_factor;
 
 #define V3D_SHADING_MATERIAL_COLOR 0
 #define V3D_SHADING_TEXTURE_COLOR 3
+#define V3D_SHADING_VERTEX_COLOR 5
 
 in vec4 finalColor;
 in vec2 texCoord_interp;
@@ -210,7 +211,8 @@ void main()
   /* for solid override color */
   if (shading_type[0] == OB_SOLID) {
     if ((shading_type[1] != V3D_SHADING_MATERIAL_COLOR) &&
-        (shading_type[1] != V3D_SHADING_TEXTURE_COLOR)) {
+        (shading_type[1] != V3D_SHADING_TEXTURE_COLOR) &&
+        (shading_type[1] != V3D_SHADING_VERTEX_COLOR)) {
       fragColor = wire_color;
     }
     if (viewport_xray == 1) {
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl
index 87963c66858..33d7d714231 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl
@@ -26,6 +26,7 @@ out vec4 finalprev_pos;
 
 #define V3D_SHADING_MATERIAL_COLOR 0
 #define V3D_SHADING_TEXTURE_COLOR 3
+#define V3D_SHADING_VERTEX_COLOR 5
 
 float defaultpixsize = pixsize * (1000.0 / pixfactor);
 
@@ -52,7 +53,8 @@ void main()
   /* for solid override color */
   if (shading_type[0] == OB_SOLID) {
     if ((shading_type[1] != V3D_SHADING_MATERIAL_COLOR) &&
-        (shading_type[1] != V3D_SHADING_TEXTURE_COLOR)) {
+        (shading_type[1] != V3D_SHADING_TEXTURE_COLOR) &&
+        (shading_type[1] != V3D_SHADING_VERTEX_COLOR)) {
       finalColor = wire_color;
     }
     if (viewport_xray == 1) {
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl
index 582b9a7f249..8df08f0bf68 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl
@@ -24,6 +24,7 @@ out vec2 finaluvdata;
 
 #define V3D_SHADING_MATERIAL_COLOR 0
 #define V3D_SHADING_TEXTURE_COLOR 3
+#define V3D_SHADING_VERTEX_COLOR 5
 
 float defaultpixsize = pixsize * (1000.0 / pixfactor);
 
@@ -49,7 +50,8 @@ void main(void)
   /* for solid override color */
   if (shading_type[0] == OB_SOLID) {
     if ((shading_type[1] != V3D_SHADING_MATERIAL_COLOR) &&
-        (shading_type[1] != V3D_SHADING_TEXTURE_COLOR)) {
+        (shading_type[1] != V3D_SHADING_TEXTURE_COLOR) &&
+        (shading_type[1] != V3D_SHADING_VERTEX_COLOR)) {
       finalColor = wire_color;
     }
     if (viewport_xray == 1) {



More information about the Bf-blender-cvs mailing list