Blender Git Loki

Git Commits -> Revision 496045f

Revision 496045f by Campbell Barton (master)
June 8, 2021, 07:13 (GMT)
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.

Commit Details:

Full Hash: 496045fc30f72be8d2ca32394ed233266f043152
Parent Commit: f651cc6
Lines Changed: +157, -201

3 Modified Paths:

/source/blender/bmesh/intern/bmesh_mesh_normals.c (+156, -175) (Diff)
/source/blender/bmesh/intern/bmesh_mesh_partial_update.c (+1, -21) (Diff)
/source/blender/bmesh/intern/bmesh_mesh_partial_update.h (+0, -5) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021