[Bf-blender-cvs] [5740dc8f2a2] greasepencil-object: GPencil: Improve gradient stroke thickness

Antonioya noreply at git.blender.org
Wed Apr 10 20:01:33 CEST 2019


Commit: 5740dc8f2a27cd1c0b2ceb0d587f5796187b6012
Author: Antonioya
Date:   Wed Apr 10 20:01:25 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB5740dc8f2a27cd1c0b2ceb0d587f5796187b6012

GPencil: Improve gradient stroke thickness

This change tries to improve the control of thickness when mix strength and gradient.

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

M	source/blender/draw/engines/gpencil/shaders/gpencil_point_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 796f234a22e..32a8c66daeb 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
@@ -62,7 +62,9 @@ void main()
 	}
 	
 	if ((mode == GPENCIL_MODE_DOTS) && (gradient_f < 1.0)) {
-		fragColor.a = clamp(fragColor.a - (length(centered) * 2 * (1.0 - gradient_f)), 0.0, 1.0);
+		float dist = length(centered) * 2;
+		float decay = dist * (1.0 - gradient_f) * fragColor.a;
+		fragColor.a = clamp(fragColor.a - decay, 0.0, 1.0);
 		fragColor.a = fragColor.a * (1.0 - ellip);
 	}



More information about the Bf-blender-cvs mailing list