[Bf-blender-cvs] [80109a69eae] greasepencil-refactor: GPencil: Refactor: Remove 3D stroke offset

Clément Foucault noreply at git.blender.org
Fri Jan 10 14:01:27 CET 2020


Commit: 80109a69eae9894c52826688cbd6c2336151406b
Author: Clément Foucault
Date:   Fri Jan 10 13:59:35 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB80109a69eae9894c52826688cbd6c2336151406b

GPencil: Refactor: Remove 3D stroke offset

This is conflicting with overlays and makes objects poke through each
others. As the 3D mode is intended to 3D drawing, it should have correct
3D positionning. This will however create a lot of zfighting artifacts on
overlapping strokes.

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

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 b1d851a394f..7d12c6e61e4 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -444,8 +444,6 @@ void stroke_vertex()
   if (strokeOrder3d) {
     /* Use the fragment depth (see fragment shader). */
     depth = -1.0;
-    /* We still offset the fills a little to avoid overlaps */
-    gl_Position.z -= (stroke_id1 + strokeIndexOffset + 1.0) * 0.000002;
   }
 #  ifdef GP_MATERIAL_BUFFER_LEN
   else if (GP_FLAG_TEST(materials[m].flag, GP_STROKE_OVERLAP)) {
@@ -500,7 +498,7 @@ void fill_vertex()
     /* Use the fragment depth (see fragment shader). */
     depth = -1.0;
     /* We still offset the fills a little to avoid overlaps */
-    gl_Position.z -= (stroke_id1 + strokeIndexOffset) * 0.000002;
+    gl_Position.z += 0.000002;
   }
   else {
     /* Use the index of first point of the stroke as depth. */



More information about the Bf-blender-cvs mailing list