[Bf-blender-cvs] [2e7764b8f05] greasepencil-refactor: GPencil: Refactor: Make Stroke as dot (lonely vert stroke) use obj orient.

Clément Foucault noreply at git.blender.org
Thu Jan 23 22:34:42 CET 2020


Commit: 2e7764b8f05cd44d1f67b246209f555b477dce52
Author: Clément Foucault
Date:   Thu Jan 23 22:32:54 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB2e7764b8f05cd44d1f67b246209f555b477dce52

GPencil: Refactor: Make Stroke as dot (lonely vert stroke) use obj orient.

This is to be more consistent with the UV behavior of a full stroke.

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

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 e2655d05277..83fa9d5d0f6 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -383,16 +383,17 @@ void stroke_vertex()
     if (alignement == GP_STROKE_ALIGNMENT_STROKE) {
       x_axis = (ma2.x == -1.0) ? line_adj : line;
     }
-    else if (alignement == GP_STROKE_ALIGNMENT_OBJECT) {
+    else if (alignement == GP_STROKE_ALIGNMENT_FIXED) {
+      /* Default for no-material drawing. */
+      x_axis = vec2(1.0, 0.0);
+    }
+    else
+#  endif
+    { /* GP_STROKE_ALIGNMENT_OBJECT */
       vec4 ndc_x = point_world_to_ndc(wpos1 + model_mat[0].xyz);
       vec2 ss_x = project_to_screenspace(ndc_x);
       x_axis = safe_normalize(ss_x - ss1);
     }
-    else /* GP_STROKE_ALIGNMENT_FIXED*/
-#  endif
-    {
-      x_axis = vec2(1.0, 0.0);
-    }
 
     /* Rotation: Encoded as Cos + Sin sign. */
     float rot_sin = sqrt(1.0 - uv1.w * uv1.w) * sign(uv1.w);



More information about the Bf-blender-cvs mailing list