Mesh: Replace auto smooth with node group #108014

Merged
Hans Goudey merged 149 commits from HooglyBoogly/blender:refactor-mesh-corner-normals-lazy into main 2023-10-20 16:54:20 +02:00
1 changed files with 17 additions and 12 deletions
Showing only changes of commit 25f7a516fb - Show all commits

View File

@ -849,7 +849,11 @@ static void mesh_edges_sharp_tag(const OffsetIndices<int> faces,
}
}
static void build_edge_to_loop_map(const OffsetIndices<int> faces,
/**
HooglyBoogly marked this conversation as resolved Outdated

suggestion: this reads like a generic map generation function, it could include that this is for calculating sharp edges.

*suggestion*: this reads like a generic map generation function, it could include that this is for calculating sharp edges.
* Builds a simplified map from edges to face corners, marking special values when
* it encounters sharp edges or borders between faces with flipped winding orders.
*/
static void build_edge_to_loop_map_with_flip_and_sharp(const OffsetIndices<int> faces,
const Span<int> corner_verts,
const Span<int> corner_edges,
const Span<bool> sharp_faces,
@ -1370,7 +1374,8 @@ void normals_calc_loop(const Span<float3> vert_positions,
array_utils::gather(vert_normals, corner_verts, r_loop_normals, 1024);
/* This first loop check which edges are actually smooth, and compute edge vectors. */
build_edge_to_loop_map(faces,
build_edge_to_loop_map_with_flip_and_sharp(
faces,
corner_verts,
corner_edges,
Span<bool>(sharp_faces, sharp_faces ? faces.size() : 0),