Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jbakker>2020-03-26 16:32:13 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2020-03-26 16:35:27 +0300
commit2e8fb95e7c69274944ecb44b2b51f8b4307f88ae (patch)
tree0ddd01a5745a20553a6dae83f9d038f3e49f4a5a
parent0545a8472946ecc7391f8554c4a214b45952d19e (diff)
SubDiv: Incorrect normals loose edges
The normals of loose edges can be non uniform as they aren't normalized. Checked with what happens with edit loose edges and synchronized the implementation. Reviewed By: Brecht van Lommel Differential Revision: https://developer.blender.org/D7127
-rw-r--r--source/blender/blenkernel/intern/subdiv_mesh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c
index 0bd6fc259c6..cdb766f2507 100644
--- a/source/blender/blenkernel/intern/subdiv_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_mesh.c
@@ -1120,8 +1120,11 @@ static void subdiv_mesh_vertex_of_loose_edge(const struct SubdivForeachContext *
* it. Maybe even using vertex varying attributes. */
subdiv_vertex->bweight = 0.0f;
/* Reset normal, initialize it in a similar way as edit mode does for a
- * vertices adjacent to a loose edges. */
- normal_float_to_short_v3(subdiv_vertex->no, subdiv_vertex->co);
+ * vertices adjacent to a loose edges.
+ * See `mesh_evaluate#mesh_calc_normals_vert_fallback` */
+ float no[3];
+ normalize_v3_v3(no, subdiv_vertex->co);
+ normal_float_to_short_v3(subdiv_vertex->no, no);
}
/* =============================================================================