3D View: add opacity for sculpt mask display
[blender.git] / source / blender / draw / modes / sculpt_mode.c
index b25a8af..e2b73a0 100644 (file)
@@ -135,9 +135,15 @@ static void SCULPT_cache_init(void *vedata)
   }
 
   {
+    const DRWContextState *draw_ctx = DRW_context_state_get();
+    View3D *v3d = draw_ctx->v3d;
+
     DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_MULTIPLY;
     psl->pass = DRW_pass_create("Sculpt Pass", state);
-    stl->g_data->group_smooth = DRW_shgroup_create(e_data.shader_smooth, psl->pass);
+
+    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;
   }
 }