diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-08-05 17:04:05 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-08-05 17:04:40 +0300 |
commit | 52f83011c8f0f4219cfc6b3a1b2d2e7104391f82 (patch) | |
tree | e7535efe1ad580a8692cb42d3ac4ae640f938791 /source | |
parent | 58229b191a177ec0192786df005c9b586991c43a (diff) |
Fix T67259 : Auto depth not working with multires in sculpt mode
Basically the solution is to call `DRW_shgroup_call_sculpt` when `BKE_sculptsession_use_pbvh_draw(...)` is true.
Ref T67259
Reviewers: fclem, jbakker, brecht
Reviewed By: fclem, brecht
Maniphest Tasks: T67259
Differential Revision: https://developer.blender.org/D5396
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/basic/basic_engine.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index dd7f4683ce0..f548bd15bf4 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -25,6 +25,7 @@ #include "DRW_render.h" +#include "BKE_paint.h" #include "BKE_particle.h" #include "DNA_particle_types.h" @@ -161,13 +162,19 @@ static void basic_cache_populate(void *vedata, Object *ob) } } - struct GPUBatch *geom = DRW_cache_object_surface_get(ob); - if (geom) { - const bool do_cull = (draw_ctx->v3d && - (draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING)); - /* Depth Prepass */ - DRW_shgroup_call( - (do_cull) ? stl->g_data->depth_shgrp_cull : stl->g_data->depth_shgrp, geom, ob); + const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d); + const bool do_cull = (draw_ctx->v3d && + (draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING)); + DRWShadingGroup *shgrp = (do_cull) ? stl->g_data->depth_shgrp_cull : stl->g_data->depth_shgrp; + + if (use_sculpt_pbvh) { + DRW_shgroup_call_sculpt(shgrp, ob, false, false, false); + } + else { + struct GPUBatch *geom = DRW_cache_object_surface_get(ob); + if (geom) { + DRW_shgroup_call(shgrp, geom, ob); + } } } |