diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2020-04-14 10:33:15 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2020-04-16 09:34:55 +0300 |
commit | a703bbb4d71c200aa02d7bdc741ad3b5cab38509 (patch) | |
tree | 4a9a62070a2ecc7b153d1ccf39612a4dcf7af86e /source | |
parent | ef19cd395fab3273e876010db1f2858df5d2f93f (diff) |
Fix T75567: Paint Mode Wireframe Incorrect
The loop normal VBO is used in two manners. In edit mode to draw the
edge normals. And in paint mode to draw the wireframe. This commit
checks which VBO is needed and build the correct one.
This allows show the wireframe correct in paint mode, when the object is
subdivided.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7419
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c index fe63dec1294..4c51ed99f2c 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh.c @@ -1648,9 +1648,12 @@ static void extract_lnor_hq_loop_mesh( normal_float_to_short_v3(&lnor_data->x, mr->poly_normals[p]); } - /* Flag for paint mode overlay. */ - if (mpoly->flag & ME_HIDE || (mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && - mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) { + /* Flag for paint mode overlay. + * Only use MR_EXTRACT_MAPPED in edit mode where it is used to display the edge-normals. In paint + * mode it will use the unmapped data to draw the wireframe. */ + if (mpoly->flag & ME_HIDE || + (mr->edit_bmesh && mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && + mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) { lnor_data->w = -1; } else if (mpoly->flag & ME_FACE_SEL) { @@ -1724,9 +1727,12 @@ static void extract_lnor_loop_mesh( *lnor_data = GPU_normal_convert_i10_v3(mr->poly_normals[p]); } - /* Flag for paint mode overlay. */ - if (mpoly->flag & ME_HIDE || (mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && - mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) { + /* Flag for paint mode overlay. + * Only use MR_EXTRACT_MAPPED in edit mode where it is used to display the edge-normals. In paint + * mode it will use the unmapped data to draw the wireframe. */ + if (mpoly->flag & ME_HIDE || + (mr->edit_bmesh && mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && + mr->v_origindex[mloop->v] == ORIGINDEX_NONE)) { lnor_data->w = -1; } else if (mpoly->flag & ME_FACE_SEL) { |