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/blenkernel/intern/particle.c | |
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/blenkernel/intern/particle.c')
0 files changed, 0 insertions, 0 deletions