[Bf-blender-cvs] [52f83011c8f] master: Fix T67259 : Auto depth not working with multires in sculpt mode

mano-wii noreply at git.blender.org
Mon Aug 5 16:06:35 CEST 2019


Commit: 52f83011c8f0f4219cfc6b3a1b2d2e7104391f82
Author: mano-wii
Date:   Mon Aug 5 11:04:05 2019 -0300
Branches: master
https://developer.blender.org/rB52f83011c8f0f4219cfc6b3a1b2d2e7104391f82

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

===================================================================

M	source/blender/draw/engines/basic/basic_engine.c

===================================================================

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);
+    }
   }
 }



More information about the Bf-blender-cvs mailing list