diff options
Diffstat (limited to 'source')
6 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index 58e30b7f349..afec92a894d 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -1205,7 +1205,7 @@ struct DRWSubdivUboStorage { uint total_dispatch_size; int is_edit_mode; - int _pad2; + int use_hide; int _pad3; }; @@ -1237,6 +1237,7 @@ static void draw_subdiv_init_ubo_storage(const DRWSubdivCache *cache, ubo->coarse_face_loopstart_mask = SUBDIV_COARSE_FACE_LOOP_START_MASK; ubo->total_dispatch_size = total_dispatch_size; ubo->is_edit_mode = cache->is_edit_mode; + ubo->use_hide = cache->use_hide; } static void draw_subdiv_ubo_update_and_bind(const DRWSubdivCache *cache, @@ -2084,6 +2085,7 @@ static bool draw_subdiv_create_requested_buffers(Object *ob, MeshRenderData *mr = mesh_render_data_create( ob, mesh, is_editmode, is_paint_mode, is_mode_active, obmat, do_final, do_uvedit, ts); mr->use_hide = use_hide; + draw_cache->use_hide = use_hide; /* Used for setting loop normals flags. Mapped extraction is only used during edit mode. * See comments in #extract_lnor_iter_poly_mesh. diff --git a/source/blender/draw/intern/draw_subdivision.h b/source/blender/draw/intern/draw_subdivision.h index c56e2a272ad..ef580fc116a 100644 --- a/source/blender/draw/intern/draw_subdivision.h +++ b/source/blender/draw/intern/draw_subdivision.h @@ -180,6 +180,7 @@ typedef struct DRWSubdivCache { /* Extra flags, passed to the UBO. */ bool is_edit_mode; + bool use_hide; } DRWSubdivCache; /* Only frees the data of the cache, caller is responsible to free the cache itself if necessary. diff --git a/source/blender/draw/intern/shaders/common_subdiv_ibo_lines_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_ibo_lines_comp.glsl index 3244b7960d8..eacdf8e6333 100644 --- a/source/blender/draw/intern/shaders/common_subdiv_ibo_lines_comp.glsl +++ b/source/blender/draw/intern/shaders/common_subdiv_ibo_lines_comp.glsl @@ -35,7 +35,7 @@ void emit_line(uint line_offset, uint quad_index, uint start_loop_index, uint co uint coarse_quad_index = coarse_polygon_index_from_subdiv_quad_index(quad_index, coarse_poly_count); - if (is_face_hidden(coarse_quad_index) || + if (use_hide && is_face_hidden(coarse_quad_index) || (input_origindex[vertex_index] == ORIGINDEX_NONE && optimal_display)) { output_lines[line_offset + 0] = 0xffffffff; output_lines[line_offset + 1] = 0xffffffff; diff --git a/source/blender/draw/intern/shaders/common_subdiv_ibo_tris_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_ibo_tris_comp.glsl index ce3c8478d3f..a46d69eca88 100644 --- a/source/blender/draw/intern/shaders/common_subdiv_ibo_tris_comp.glsl +++ b/source/blender/draw/intern/shaders/common_subdiv_ibo_tris_comp.glsl @@ -45,7 +45,7 @@ void main() int triangle_loop_index = (int(quad_index) + mat_offset) * 6; #endif - if (is_face_hidden(coarse_quad_index)) { + if (use_hide && is_face_hidden(coarse_quad_index)) { output_tris[triangle_loop_index + 0] = 0xffffffff; output_tris[triangle_loop_index + 1] = 0xffffffff; output_tris[triangle_loop_index + 2] = 0xffffffff; diff --git a/source/blender/draw/intern/shaders/common_subdiv_lib.glsl b/source/blender/draw/intern/shaders/common_subdiv_lib.glsl index 1be6619dbad..4183b4a1cd3 100644 --- a/source/blender/draw/intern/shaders/common_subdiv_lib.glsl +++ b/source/blender/draw/intern/shaders/common_subdiv_lib.glsl @@ -38,6 +38,8 @@ layout(std140) uniform shader_data uint total_dispatch_size; bool is_edit_mode; + + bool use_hide; }; uint get_global_invocation_index() diff --git a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl index e146ccb343a..81e346863c2 100644 --- a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl +++ b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl @@ -427,7 +427,7 @@ void main() output_nors[coarse_quad_index] = fnor; # endif - if (is_face_hidden(coarse_quad_index)) { + if (use_hide && is_face_hidden(coarse_quad_index)) { output_indices[coarse_quad_index] = 0xffffffff; } else { |