Blender Git Commit Log

Git Commits -> Revision 119846a

Revision 119846a by Lukas Stockner (master)
November 17, 2017, 17:34 (GMT)
Mikktspace: Speed up the merging of identical vertices

Previously, Mikktspace just bucketed the vertices based on one spatial coordinate and then ran full pairwise comparisons inside each bucket.
However, since models are three-dimensional, the bucketing has a massive false-positive rate, and since pairwise comparison is O(n^2), the merging process is very slow.

But, since we only care about exactly identical vertices, there is a much more efficient approach - we can just hash all values belonging to each vertex and form buckets based on the hash.
Since the hash has 32 bits and considers all values, false-positives are very unlikely - and since both hashing and the radixsort that's used for bucketing are O(n), both asymptotical and
real-world performance (as well as code complexity) are significantly improved.

Commit Details:

Full Hash: 119846a6bb366f5ae13db18d965083d7927ff11e
Parent Commit: 40f528a
Lines Changed: +95, -268

1 Modified Path:

/intern/mikktspace/mikktspace.c (+95, -268) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021