[Bf-blender-cvs] [530d81c240d] greasepencil-object: GPencil: More changes in gradient calculation for points

Antonioya noreply at git.blender.org
Tue Mar 19 14:08:03 CET 2019


Commit: 530d81c240d04aeff1390d18994671879469169e
Author: Antonioya
Date:   Tue Mar 19 13:44:24 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB530d81c240d04aeff1390d18994671879469169e

GPencil: More changes in gradient calculation for points

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

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 833329a11ce..7a70fff189d 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
@@ -62,11 +62,18 @@ void main()
 	}
 	
 	if (gradient_f < 1.0) {
-		float in_rad = gradient_f / 4.0;
-		float ex_rad = rad_squared - in_rad;
+	
+		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);
+	
+	
+		// float in_rad = gradient_f / 4.0;
+		// float ex_rad = rad_squared - in_rad;
 
-		float alpha = clamp((dist_squared - in_rad) / ex_rad, 0.0, 1.0);
-		fragColor.a = smoothstep(fragColor.a, 0.0, ellip);
+		// float alpha = clamp((dist_squared - in_rad) / ex_rad, 0.0, 1.0);
+		// fragColor.a = smoothstep(fragColor.a, 0.0, ellip);
 	}
 	
 	if(fragColor.a < 0.0035)



More information about the Bf-blender-cvs mailing list