diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-05-13 18:07:32 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-05-13 23:44:04 +0300 |
commit | fd025b0b7a46c5e56f348b73cf989c6bbddec707 (patch) | |
tree | c6a03da09765292b02a7eec062c9f9092a936546 /source/blender/draw/engines/overlay | |
parent | 16cc424bc53f22d4158fb2ed109b14943f340d7b (diff) |
GPencil: Add new X-Ray option for Canvas Grid
In some situations is good to have a grid visible anot beeing occulde by meshes.
By default is OFF.
Differential Revision: https://developer.blender.org/D7721
Diffstat (limited to 'source/blender/draw/engines/overlay')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_gpencil.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_gpencil.c b/source/blender/draw/engines/overlay/overlay_gpencil.c index b79d5753686..1397ef7b4b2 100644 --- a/source/blender/draw/engines/overlay/overlay_gpencil.c +++ b/source/blender/draw/engines/overlay/overlay_gpencil.c @@ -204,6 +204,7 @@ void OVERLAY_gpencil_cache_init(OVERLAY_Data *vedata) const bool show_grid = (v3d->gp_flag & V3D_GP_SHOW_GRID) != 0 && ((ts->gpencil_v3d_align & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE)) == 0); + const bool grid_xray = (v3d->gp_flag & V3D_GP_SHOW_GRID_XRAY); if (show_grid && show_overlays) { const char *grid_unit = NULL; @@ -256,7 +257,9 @@ void OVERLAY_gpencil_cache_init(OVERLAY_Data *vedata) const int gridlines = (gpd->grid.lines <= 0) ? 1 : gpd->grid.lines; int line_ct = gridlines * 4 + 2; - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND_ALPHA; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA; + state |= (grid_xray) ? DRW_STATE_DEPTH_ALWAYS : DRW_STATE_DEPTH_LESS_EQUAL; + DRW_PASS_CREATE(psl->gpencil_canvas_ps, state); sh = OVERLAY_shader_gpencil_canvas(); |