diff options
author | Antonioya <blendergit@gmail.com> | 2019-06-26 14:37:33 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-06-26 14:38:10 +0300 |
commit | 57bb575aa85e82ef10159e67d33a0b27ce6d9246 (patch) | |
tree | b5ec0a69fc4c5be54cc3aac8f9b5607b184d7ea3 /source/blender/draw/engines/gpencil/gpencil_engine.h | |
parent | 9dea69149ab54e59c8c3e2d341d0fc73c7a99527 (diff) |
Fix T65958: GPencil glitches in line strokes with alpha
Following @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. 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.
Thanks to Clément for his help and support. It's always a pleasure working with him.
Review by: @fclem
Testers: @mendio @pepeland
See D5126 for more details
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_engine.h')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index fa8745f3db9..957acb8c780 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -514,7 +514,8 @@ void GPENCIL_render_to_image(void *vedata, if ((lvl > 0) && (fbl->multisample_fb != NULL) && (DRW_state_is_fbo())) { \ DRW_stats_query_start("GP Multisample Blit"); \ GPU_framebuffer_bind(fbl->multisample_fb); \ - GPU_framebuffer_clear_color_depth(fbl->multisample_fb, (const float[4]){0.0f}, 1.0f); \ + GPU_framebuffer_clear_color_depth_stencil( \ + fbl->multisample_fb, (const float[4]){0.0f}, 1.0f, 0x0); \ DRW_stats_query_end(); \ } \ } \ |