Page MenuHome

Sculpt: Improve fake neighbors searching

Authored by Pablo Dobarro (pablodp606) on Jun 30 2020, 6:33 PM.



Previously, fake neighbors were initialized to the closest vertex in
another connected component and all vertices that already have a fake
neighbor were ignored. This makes the update process faster as each fake
neighbor found allows to skip one extra vertex for searching.

Now, this search a fake neighbor for all vertices and ensures that
neighbors with larger distance between them are updated with new ones
with shortest distances. This makes the update process slower, but it
improves the result and it may fix some artifacts.

(I can add the code to preview the fake neighbors as a sculpt mode option if you find it useful)



Diff Detail

rB Blender
fake-neighbors-improvements (branched from master)
Build Status
Buildable 8778
Build 8778: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Jun 30 2020, 6:33 PM
Pablo Dobarro (pablodp606) created this revision.
Sergey Sharybin (sergey) requested changes to this revision.Jul 1 2020, 9:53 AM

Use _sq suffix for squared units.

This makes the update process slower

How much slower?

This revision now requires changes to proceed.Jul 1 2020, 9:53 AM
Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)
  • Review update

@Sergey Sharybin (sergey) It depends on the mesh vertex distribution. If it can't find a neighbor for any vertex it is the same, if all vertices have one neighbor (very unlikely) it is two times slower

You should be able to get time metrics from typical files you're working on. You should also be able to get worst case scenario (which I guess is the 2x you've mentioned).
This information needs to come together with the commit message, as it brings a lot of information.

The code looks good now, just make sure the timing information is in the final commit message.

This revision is now accepted and ready to land.Jul 2 2020, 10:14 AM