diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-04 02:39:35 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-04 15:11:04 +0300 |
commit | b2f1a6587410d00ad3bbd22e045979f80048afe2 (patch) | |
tree | 8312daea35aed37a1cdba6d6e6e97958b7f21d47 /source/blender/draw/modes/sculpt_mode.c | |
parent | 1d8ed6dcd7cd2b3ccfaaacb59387dca481262eb6 (diff) |
Sculpt: Refactor draw manager sculpt drawing mechanism
Workbench/Eevee now displays multiple multi-materials correctly.
Iterate over pbvh nodes when doing object iteration. This makes the
rendering process more streamlined and allow for using different materials.
This change will make possible to:
- Add culling pass of each pbvh leaf node. (speedup if zoomed on a small
area)
- Reduce number of lead node iteration.
- Reduce code complexity
Diffstat (limited to 'source/blender/draw/modes/sculpt_mode.c')
-rw-r--r-- | source/blender/draw/modes/sculpt_mode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/modes/sculpt_mode.c b/source/blender/draw/modes/sculpt_mode.c index 8adae0a4238..fb2619ce768 100644 --- a/source/blender/draw/modes/sculpt_mode.c +++ b/source/blender/draw/modes/sculpt_mode.c @@ -98,6 +98,7 @@ static struct { } e_data = {NULL}; /* Engine data */ typedef struct SCULPT_PrivateData { + DRWShadingGroup *mask_overlay_grp; /* This keeps the references of the shading groups for * easy access in SCULPT_cache_populate() */ DRWShadingGroup *group_flat; @@ -143,7 +144,7 @@ static void SCULPT_cache_init(void *vedata) DRWShadingGroup *shgrp = DRW_shgroup_create(e_data.shader_smooth, psl->pass); DRW_shgroup_uniform_float(shgrp, "maskOpacity", &v3d->overlay.sculpt_mode_mask_opacity, 1); - stl->g_data->group_smooth = shgrp; + stl->g_data->mask_overlay_grp = shgrp; } } @@ -213,8 +214,7 @@ static void SCULPT_cache_populate(void *vedata, Object *ob) PBVH *pbvh = ob->sculpt->pbvh; if (pbvh && pbvh_has_mask(pbvh)) { - DRW_shgroup_call_generate_add( - stl->g_data->group_smooth, sculpt_draw_mask_cb, ob, ob->obmat); + DRW_shgroup_call_sculpt_add(stl->g_data->mask_overlay_grp, ob, false, true, false); } } } |