[Bf-blender-cvs] [81986682284] greasepencil-object: Apply strength factor to textured strokes

Antonio Vazquez noreply at git.blender.org
Sat Feb 24 20:01:24 CET 2018


Commit: 81986682284e84c68b56a2b522f57bf2ed2c4a79
Author: Antonio Vazquez
Date:   Sat Feb 24 20:01:14 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB81986682284e84c68b56a2b522f57bf2ed2c4a79

Apply strength factor to textured strokes

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

M	source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
M	source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl

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

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
index d25ca28154a..e77e3df13aa 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
@@ -31,11 +31,14 @@ void main()
 	/* texture */
 	if (color_type == GPENCIL_COLOR_TEXTURE) {
 		fragColor =  texture2D(myTexture, mTexCoord);
+		/* mult both alpha factor to use strength factor with texture */
+		fragColor.a = min(fragColor.a * mColor.a, fragColor.a);
 	}
 	/* pattern */
 	if (color_type == GPENCIL_COLOR_PATTERN) {
 		vec4 text_color = texture2D(myTexture, mTexCoord);
 		fragColor = mColor;
-		fragColor.a = min(text_color.a, mColor.a);
+		/* mult both alpha factor to use strength factor with color alpha limit */
+		fragColor.a = min(text_color.a * mColor.a, mColor.a);
 	}
 }
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl
index f606dca9187..d57921c1629 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl
@@ -33,11 +33,14 @@ void main()
 	/* texture */
 	if (color_type == GPENCIL_COLOR_TEXTURE) {
 		fragColor =  texture2D(myTexture, mTexCoord);
+		/* mult both alpha factor to use strength factor */
+		fragColor.a = min(fragColor.a * tColor.a, fragColor.a);
 	}
 	/* pattern */
 	if (color_type == GPENCIL_COLOR_PATTERN) {
 		vec4 text_color = texture2D(myTexture, mTexCoord);
 		fragColor = tColor;
-		fragColor.a = min(text_color.a, tColor.a);
+		/* mult both alpha factor to use strength factor with color alpha limit */
+		fragColor.a = min(text_color.a * tColor.a, tColor.a);
 	}
 }



More information about the Bf-blender-cvs mailing list