diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-03-30 15:39:16 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-03-30 15:39:16 +0300 |
commit | a2d19c1f781157eadc57db27ac59338bc9fa22c8 (patch) | |
tree | e3f35eff0e26b2a09f746058323ad22fd1e9763e /source/blender/draw/intern/draw_cache_extract_mesh.c | |
parent | 57d8bde0886ff7573e69c1fbe4d857cb3373e7a7 (diff) |
NormalOverlay: Center Dot Normal Drawing With Modifiers
When using generative modifiers too many center dots were rendered in
the normal overlay. This patch only renders the normals of original
center dots.
Known issue: decoding the `norAndFlag` has issues on Intel GPU.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; } |