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);
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to