diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-08 08:54:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-08 10:13:15 +0300 |
commit | 496045fc30f72be8d2ca32394ed233266f043152 (patch) | |
tree | ef4302fc0ec3c4b57c04d0ffdc884fb5a986f98c /source/blender/bmesh/intern/bmesh_mesh_partial_update.h | |
parent | f651cc6c4eda0764b085f824a42e0d407b258705 (diff) |
BMesh: simplify normal calculation, resolve partial update error
Simplify vertex normal calculation by moving the main normal
accumulation function to operate on vertices instead of faces.
Using faces had the down side that it needed to zero, accumulate and
normalize the vertex normals in 3 separate passes, accumulating also
needed a spin-lock for thread since the face would write it's normal
to all of it's vertices which could be shared with other faces.
Now a single loop over vertices is performed without locking.
This gives 5-6% speedup calculating all normals.
This also simplifies partial updates, fixing a problem where
all connected faces were being read from when calculating normals.
While this could have been resolved separately,
it's simpler to operate on vertices directly.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mesh_partial_update.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_partial_update.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh_partial_update.h b/source/blender/bmesh/intern/bmesh_mesh_partial_update.h index c0c9b275fa4..b31ec127744 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_partial_update.h +++ b/source/blender/bmesh/intern/bmesh_mesh_partial_update.h @@ -49,11 +49,6 @@ typedef struct BMPartialUpdate { int verts_len, verts_len_alloc; int edges_len, edges_len_alloc; int faces_len, faces_len_alloc; - /** - * Faces at the end of `faces` that don't need to have the normals recalculated - * but must be included when waiting the vertex normals. - */ - int faces_len_normal_calc_accumulate; /** Store the parameters used in creation so invalid use can be asserted. */ BMPartialUpdate_Params params; |