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
This commit is contained in:
parent
58229b191a
commit
52f83011c8
Notes:
blender-bot
2023-02-14 11:25:11 +01:00
Referenced by issue #67259, Auto depth not working with multires in sculpt mode
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue