diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-31 15:04:16 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-31 18:17:03 +0300 |
commit | 692891f69ea42af0ba890f5f92cbd1a3260442c9 (patch) | |
tree | 1aeb9469b7a2b26a8a25a09c6045faa51d34944b /source/blender/draw/engines/eevee/eevee_materials.c | |
parent | 9899999e944c0d954dbe5a7aa96c8e1680e7b3f8 (diff) |
Fix sculpt mode drawing with modifiers still being wrong in some cases
Centralize logic for when to use the PBVH for drawing, fix missing tests in
mask drawing, fix missing tests for multiple windows, only do more expensive
update for all viewports at end of the stroke.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 3b78d8718ef..2b8673e2f53 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -28,9 +28,8 @@ #include "BLI_rand.h" #include "BLI_string_utils.h" -#include "BKE_particle.h" #include "BKE_paint.h" -#include "BKE_pbvh.h" +#include "BKE_particle.h" #include "DNA_world_types.h" #include "DNA_modifier_types.h" @@ -1535,10 +1534,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, Scene *scene = draw_ctx->scene; GHash *material_hash = stl->g_data->material_hash; - bool is_sculpt_mode = DRW_object_use_pbvh_drawing(ob); - /* For now just force fully shaded with eevee when supported. */ - is_sculpt_mode = is_sculpt_mode && - !(ob->sculpt->pbvh && BKE_pbvh_type(ob->sculpt->pbvh) == PBVH_FACES); + bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d); /* First get materials for this mesh. */ if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) { @@ -1606,7 +1602,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, int auto_layer_count; struct GPUBatch **mat_geom = NULL; - if (!is_sculpt_mode) { + if (!use_sculpt_pbvh) { mat_geom = DRW_cache_object_surface_material_get(ob, gpumat_array, materials_len, @@ -1615,7 +1611,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, &auto_layer_count); } - if (is_sculpt_mode) { + if (use_sculpt_pbvh) { /* Vcol is not supported in the modes that require PBVH drawing. */ bool use_vcol = false; DRW_shgroup_call_sculpt_with_materials(shgrp_array, ob, use_vcol); |