[Bf-blender-cvs] [b0744c7855d] greasepencil-object: Use fix UVs for solid stroke

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


Commit: b0744c7855d0a3e635f8bcc89bd30fe2a8f273c1
Author: Antonio Vazquez
Date:   Tue Feb 20 16:06:36 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBb0744c7855d0a3e635f8bcc89bd30fe2a8f273c1

Use fix UVs for solid stroke

If the stroke is solid, use fixed uvs to avoid any possible gap.

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

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 99e4f51beea..7fe8e4e44ff 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
@@ -170,25 +170,45 @@ void main(void)
 	}
 
 	/* generate the triangle strip */
-	mTexCoord = vec2(finaluvdata[1].x, 0);
+	if (color_type == GPENCIL_COLOR_SOLID) {
+		mTexCoord = vec2(0, 0);
+	}
+	else {
+		mTexCoord = vec2(finaluvdata[1].x, 0);
+	}
 	mColor = finalColor[1];
 	uvfac = 0;
 	gl_Position = vec4((sp1 + length_a * miter_a) / Viewport, getZdepth(P1), 1.0);
 	EmitVertex();
 
-	mTexCoord = vec2(finaluvdata[1].x, 1);
+	if (color_type == GPENCIL_COLOR_SOLID) {
+		mTexCoord = vec2(0, 1);
+	}
+	else {
+		mTexCoord = vec2(finaluvdata[1].x, 1);
+	}
 	mColor = finalColor[1];
 	uvfac = 0;
 	gl_Position = vec4((sp1 - length_a * miter_a) / Viewport, getZdepth(P1), 1.0);
 	EmitVertex();
 
-	mTexCoord = vec2(finaluvdata[2].x, 0);
+	if (color_type == GPENCIL_COLOR_SOLID) {
+		mTexCoord = vec2(1, 0);
+	}
+	else {
+		mTexCoord = vec2(finaluvdata[2].x, 0);
+	}
 	mColor = finalColor[2];
 	uvfac = 0;
 	gl_Position = vec4((sp2 + length_b * miter_b) / Viewport, getZdepth(P2), 1.0);
 	EmitVertex();
 
-	mTexCoord = vec2(finaluvdata[2].x, 1);
+	if (color_type == GPENCIL_COLOR_SOLID) {
+		mTexCoord = vec2(1, 1);
+	}
+	else {
+		mTexCoord = vec2(finaluvdata[2].x, 1);
+	}
 	mColor = finalColor[2];
 	uvfac = 0;
 	gl_Position = vec4((sp2 - length_b * miter_b) / Viewport, getZdepth(P2), 1.0);



More information about the Bf-blender-cvs mailing list