[Bf-blender-cvs] [2e15d015cd0] greasepencil-object: GPencil: Disable Stencil for Dots and Fill shading groups

Antonioya noreply at git.blender.org
Sat Jun 22 17:55:58 CEST 2019


Commit: 2e15d015cd0679e327316d2b437fe971d8273fc4
Author: Antonioya
Date:   Tue Jun 18 17:41:25 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2e15d015cd0679e327316d2b437fe971d8273fc4

GPencil: Disable Stencil for Dots and Fill shading groups

This types don't need stencil check because the stencil "kill" artistic effects.

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

M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 0a378ef1704..b32bd4f299e 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1769,9 +1769,10 @@ static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data,
         stl->storage->shgroup_id++;
         start_point = elm->vertex_idx;
 
-        /* set stencil mask id */
-        DRW_shgroup_stencil_mask(shgrp, stencil_id);
-        stencil_id++;
+        /* Disable stencil for this type */
+        DRW_shgroup_state_disable(shgrp, DRW_STATE_WRITE_STENCIL | DRW_STATE_STENCIL_NEQUAL);
+        /* set stencil mask id as not used */
+        DRW_shgroup_stencil_mask(shgrp, 0x00f);
         break;
       }
       case eGpencilBatchGroupType_Fill: {
@@ -1794,9 +1795,10 @@ static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data,
         stl->storage->shgroup_id++;
         start_fill = elm->vertex_idx;
 
-        /* set stencil mask id */
-        DRW_shgroup_stencil_mask(shgrp, stencil_id);
-        stencil_id++;
+        /* Disable stencil for this type */
+        DRW_shgroup_state_disable(shgrp, DRW_STATE_WRITE_STENCIL | DRW_STATE_STENCIL_NEQUAL);
+        /* set stencil mask id as not used */
+        DRW_shgroup_stencil_mask(shgrp, 0x00f);
         break;
       }
       case eGpencilBatchGroupType_Edit: {



More information about the Bf-blender-cvs mailing list