[Bf-blender-cvs] [2c2ff7826a7] greasepencil-object: Missing in previous commit (encaps for solid only)

Antonio Vazquez noreply at git.blender.org
Tue Feb 20 17:02:15 CET 2018


Commit: 2c2ff7826a7ad941b6bb2f9d22c3e5466a018357
Author: Antonio Vazquez
Date:   Mon Feb 19 19:25:17 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB2c2ff7826a7ad941b6bb2f9d22c3e5466a018357

Missing in previous commit (encaps for solid only)

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

M	source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl

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

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
index 2b0e32f2445..99e4f51beea 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
@@ -1,6 +1,7 @@
 uniform mat4 ModelViewProjectionMatrix;
 uniform vec2 Viewport;
 uniform int xraymode;
+uniform int color_type;
 
 layout(lines_adjacency) in;
 layout(triangle_strip, max_vertices = 13) out;
@@ -17,6 +18,11 @@ out float uvfac;
 #define GP_XRAY_3DSPACE 1
 #define GP_XRAY_BACK  2
 
+/* keep this list synchronized with list in gpencil_engine.h */
+#define GPENCIL_COLOR_SOLID   0
+#define GPENCIL_COLOR_TEXTURE 1
+#define GPENCIL_COLOR_PATTERN 2
+
 /* project 3d point to 2d on screen space */
 vec2 toScreenSpace(vec4 vertex)
 {
@@ -142,7 +148,7 @@ void main(void)
 	}
 
 	/* generate the start endcap (alpha < 0 used as endcap flag)*/
-	if (P0 == P2) {
+	if ((P0 == P2) && (color_type == GPENCIL_COLOR_SOLID)){
 		mTexCoord = vec2(2, 1);
 		mColor = vec4(finalColor[1].rgb, finalColor[1].a * -1.0) ;
 		uvfac = 0;
@@ -189,7 +195,7 @@ void main(void)
 	EmitVertex();
 
 	/* generate the end endcap (alpha < 0 used as endcap flag)*/
-	if (P1 == P3) {
+	if ((P1 == P3) && (color_type == GPENCIL_COLOR_SOLID)){ 
 		mTexCoord = vec2(finaluvdata[2].x, 2);
 		mColor = vec4(finalColor[2].rgb, finalColor[2].a * -1.0) ;
 		uvfac = finaluvdata[2].x;



More information about the Bf-blender-cvs mailing list