[Bf-blender-cvs] [38cb90fbd36] greasepencil-object: GPencil: Second test of thin lines

Antonio Vazquez noreply at git.blender.org
Wed Jun 9 16:11:10 CEST 2021


Commit: 38cb90fbd36dd46cd61190f0ca7228859f9b72c4
Author: Antonio Vazquez
Date:   Wed Jun 9 16:11:03 2021 +0200
Branches: greasepencil-object
https://developer.blender.org/rB38cb90fbd36dd46cd61190f0ca7228859f9b72c4

GPencil: Second test of thin lines

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

M	source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl

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

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
index 9a72e93317a..e5135b58ba3 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -330,7 +330,7 @@ float stroke_thickness_modulate(float thickness)
   /* Modify stroke thickness by object and layer factors.-*/
   thickness *= thicknessScale;
   thickness += thicknessOffset;
-  thickness = max(0.05, thickness);
+  thickness = max(1.0, thickness);
 
   if (thicknessIsScreenSpace) {
     /* Multiply offset by view Z so that offset is constant in screenspace.
@@ -347,8 +347,11 @@ float stroke_thickness_modulate(float thickness)
 float clamp_small_stroke_thickness(float thickness)
 {
   /* To avoid aliasing artifacts, we clamp the line thickness and
-   * reduce its opacity in the fragment shader.*/
-  float min_thickness = gl_Position.w * 1.3;
+   * reduce its opacity in the fragment shader.
+   * The minimum thickness is not multiplied by any factor to get very thin lines.
+   */
+
+  float min_thickness = gl_Position.w * 1.0;
   thickness = max(min_thickness, thickness);
 
   return thickness;



More information about the Bf-blender-cvs mailing list