Page MenuHome

Proposed change to fix T65958 (glitches in alpha strokes)
ClosedPublic

Authored by Antonio Vazquez (antoniov) on Jun 23 2019, 4:19 PM.

Details

Summary

Following @Clément Foucault (fclem) comments, I have implemented the use of Stencil for Solid line strokes. For Dots, Boxes and Lines with texture, the stencil is not activated because "kill" some artistic effects.

We have done test in greasepencil-object branch and all it's working as expected and the FPS are equal, so the stencil hasn't any appreciable impact in the drawing time.

The Stencil is used in groups of 255 and the passes are done in the same way. If the stencil is not use for the type of stroke (Dot/Box/Texture), the drawing is grouped as much as possible to reduce GPU overhead and limit the times the stencil bit must be cleared.

For doing this patch I had to add 2 new functions for reading private data to Draw manager (this patch only contains the last one). After talking with Clément, we decided add these function as a temporary solution while the Draw Manager implements the option to clear the stencil by groups. When this option will be implemented, these functions must be removed.

Diff Detail

Event Timeline

Looks good to me. Just remove the uneeded DRW_shgroup_stencil_mask and we are good.

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

Not needed

1773

Same thing, DRW_shgroup_stencil_mask not needed.

1798

and here

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

I need this to check if stencil is used to limit the clean.

Ok let's go then.

This revision is now accepted and ready to land.Jun 26 2019, 1:24 PM

Already committed in 57bb575aa85e