diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-22 11:37:38 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-22 11:43:03 +0300 |
commit | f3501a00e249bc4a7212be1f443704066dd43482 (patch) | |
tree | b6c1c39d2a623022ae8f38d5cdb62a61202339b7 /source/blender/draw/modes/paint_vertex_mode.c | |
parent | c517778a8bf9a0fc8a60541528cbfaf3ec47c679 (diff) |
PaintMode: Full Shading Boolean => Slider
There was a Full Shading bool that was shared across the WP, VP and TP
modes. This commit makes some changes:
- Replace the bool with a factor. This gives the user more control on
the visibility.
- Also draw it on top of the Material and Rendered mode so the user can
control what he needs. In certain cases you don't want to see the final
rendered material, but the actual texture.
- Removed the skipping of objects when in paint modes. As now the paint
modes are blended.
Diffstat (limited to 'source/blender/draw/modes/paint_vertex_mode.c')
-rw-r--r-- | source/blender/draw/modes/paint_vertex_mode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c index d335e0a4d70..9cf6ea52d33 100644 --- a/source/blender/draw/modes/paint_vertex_mode.c +++ b/source/blender/draw/modes/paint_vertex_mode.c @@ -101,6 +101,8 @@ static void PAINT_VERTEX_cache_init(void *vedata) { PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; PAINT_VERTEX_StorageList *stl = ((PAINT_VERTEX_Data *)vedata)->stl; + const DRWContextState *draw_ctx = DRW_context_state_get(); + const View3D *v3d = draw_ctx->v3d; if (!stl->g_data) { /* Alloc transient pointers */ @@ -111,9 +113,10 @@ static void PAINT_VERTEX_cache_init(void *vedata) /* Create a pass */ psl->vcolor_faces = DRW_pass_create( "Vert Color Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_MULTIPLY); + DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND); stl->g_data->fvcolor_shgrp = DRW_shgroup_create(e_data.vcolor_face_shader, psl->vcolor_faces); + DRW_shgroup_uniform_float(stl->g_data->fvcolor_shgrp, "alpha", &v3d->overlay.vertex_paint_mode_opacity, 1); } { @@ -145,7 +148,7 @@ static void PAINT_VERTEX_cache_populate(void *vedata, Object *ob) if ((ob->type == OB_MESH) && (ob == draw_ctx->obact)) { const Mesh *me = ob->data; const bool use_wire = (v3d->overlay.paint_flag & V3D_OVERLAY_PAINT_WIRE) != 0; - const bool use_surface = DRW_object_is_mode_shade(ob) == true; + const bool use_surface = v3d->overlay.vertex_paint_mode_opacity != 0.0f; const bool use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0; struct Gwn_Batch *geom; |