diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl index 8833490e818..fd37bc8c534 100644 --- a/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/edit_mesh_normal_vert.glsl @@ -40,7 +40,7 @@ void main() } else { nor = norAndFlag.xyz; - if (all(equal(nor, vec3(0.0)))) { + if (all(equal(nor, vec3(0)))) { finalColor = vec4(0.0); return; } diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c index 20933a53d6f..f54fef63c82 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh.c @@ -3914,7 +3914,8 @@ static void extract_fdots_nor_finish(const MeshRenderData *mr, void *buf, void * for (int f = 0; f < mr->poly_len; f++) { efa = BM_face_at_index(mr->bm, f); const bool is_face_hidden = BM_elem_flag_test(efa, BM_ELEM_HIDDEN); - if (is_face_hidden) { + if (is_face_hidden || + (mr->extract_type == MR_EXTRACT_MAPPED && mr->p_origindex[f] == ORIGINDEX_NONE)) { nor[f] = GPU_normal_convert_i10_v3(invalid_normal); nor[f].w = NOR_AND_FLAG_HIDDEN; } @@ -3930,7 +3931,9 @@ static void extract_fdots_nor_finish(const MeshRenderData *mr, void *buf, void * else { for (int f = 0; f < mr->poly_len; f++) { efa = bm_original_face_get(mr, f); - if (!efa || BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) { + const bool is_face_hidden = efa && BM_elem_flag_test(efa, BM_ELEM_HIDDEN); + if (is_face_hidden || + (mr->extract_type == MR_EXTRACT_MAPPED && mr->p_origindex[f] == ORIGINDEX_NONE)) { nor[f] = GPU_normal_convert_i10_v3(invalid_normal); nor[f].w = NOR_AND_FLAG_HIDDEN; } |