[Bf-blender-cvs] [0c4144c4729] greasepencil-object: GPencil: Improve Gradient in Dots mode
Antonioya
noreply at git.blender.org
Wed Apr 10 10:43:05 CEST 2019
Commit: 0c4144c47299e5c0587c6d5e542031f69943f9ea
Author: Antonioya
Date: Wed Apr 10 10:42:23 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0c4144c47299e5c0587c6d5e542031f69943f9ea
GPencil: Improve Gradient in Dots mode
The old method was too complex and got weird results when mixed with brush strength. Now the result is far better.
===================================================================
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 88d0a210e50..796f234a22e 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
@@ -62,10 +62,8 @@ void main()
}
if ((mode == GPENCIL_MODE_DOTS) && (gradient_f < 1.0)) {
- float dist = length(centered) * 2.0;
- float ex = pow(dist, (-gradient_f * 2.0f));
- float alpha = clamp(1.0 - abs((1.0f - ex) / 10.0f), 0.0f, 1.0f) * ellip;
- fragColor.a = clamp(smoothstep(fragColor.a, 0.0, alpha), 0.01, 1.0);
+ fragColor.a = clamp(fragColor.a - (length(centered) * 2 * (1.0 - gradient_f)), 0.0, 1.0);
+ fragColor.a = fragColor.a * (1.0 - ellip);
}
if(fragColor.a < 0.0035) {
More information about the Bf-blender-cvs
mailing list