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_texture_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_texture_mode.c')
-rw-r--r-- | source/blender/draw/modes/paint_texture_mode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c index bd8a1c71a6a..85cff28b313 100644 --- a/source/blender/draw/modes/paint_texture_mode.c +++ b/source/blender/draw/modes/paint_texture_mode.c @@ -194,8 +194,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) { /* Create a pass */ - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | - DRW_STATE_MULTIPLY | DRW_STATE_WIRE; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND; psl->image_faces = DRW_pass_create("Image Color Pass", state); stl->g_data->shgroup_fallback = DRW_shgroup_create(e_data.fallback_sh, psl->image_faces); @@ -227,6 +226,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) if (tex) { DRWShadingGroup *grp = DRW_shgroup_create(e_data.image_sh, psl->image_faces); DRW_shgroup_uniform_texture(grp, "image", tex); + DRW_shgroup_uniform_float(grp, "alpha", &draw_ctx->v3d->overlay.texture_paint_mode_opacity, 1); stl->g_data->shgroup_image_array[i] = grp; } else { @@ -242,6 +242,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) if (tex) { DRWShadingGroup *grp = DRW_shgroup_create(e_data.image_sh, psl->image_faces); DRW_shgroup_uniform_texture(grp, "image", tex); + DRW_shgroup_uniform_float(grp, "alpha", &draw_ctx->v3d->overlay.texture_paint_mode_opacity, 1); stl->g_data->shgroup_image_array[0] = grp; } else { @@ -285,7 +286,7 @@ static void PAINT_TEXTURE_cache_populate(void *vedata, Object *ob) /* Get geometry cache */ const Mesh *me = ob->data; Scene *scene = draw_ctx->scene; - const bool use_surface = DRW_object_is_mode_shade(ob) == true; + const bool use_surface = draw_ctx->v3d->overlay.texture_paint_mode_opacity != 0.0; //DRW_object_is_mode_shade(ob) == true; const bool use_material_slots = (scene->toolsettings->imapaint.mode == IMAGEPAINT_MODE_MATERIAL); bool ok = false; |