Files
test/source/blender/blenkernel
Campbell Barton 399b6ec76c Mesh: optimize normal calculation
Optimize mesh normal calculation.

- Remove the intermediate `lnors_weighted` array, accumulate directly
  into the normal array using a spin-lock for thread safety.
- Remove single threaded iteration over loops
  (normal calculation is now fully multi-threaded).
- Remove stack array (alloca) for pre-calculating edge-directions.

Summary of Performance Characteristics:

- The largest gains are for single high poly meshes, with isolated
  normal-calculation benchmarks of meshes over ~1.5 million showing
  2x+ speedup, ~25 million polygons are ~2.85x faster.

- Single lower poly meshes (250k polys) can be ~2x slower.

  Since these meshes aren't normally a bottleneck,
  and this problem isn't noticeable on large scenes,
  we considered the performance trade-off reasonable.

- The performance difference reduces with larger scenes,
  tests with production files from "Sprite Fight" showing
  the same or slightly better overall performance.

NOTE: tested on a AMD Ryzen TR 3970X 32-Core.

For more details & benchmarking scripts, see the patch description.

Reviewed By: mont29

Ref D11993
2021-08-13 10:21:30 +10:00
..
2021-08-13 10:21:30 +10:00
2021-07-07 13:42:46 +10:00
2021-08-09 22:55:38 +10:00
2021-07-16 11:48:54 +10:00
2020-10-01 14:29:45 +02:00
2020-12-15 17:19:55 +01:00
2021-06-22 10:54:50 -07:00
2021-07-02 12:15:29 +10:00
2021-06-10 12:15:59 +02:00
2021-08-03 12:33:36 +02:00