Page MenuHome

Sculpt: Improve fake neighbors searching
AcceptedPublic

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

Details

Summary

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)

Before:

After:

Diff Detail

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

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Tue, Jun 30, 6:33 PM
Pablo Dobarro (pablodp606) created this revision.
Sergey Sharybin (sergey) requested changes to this revision.Wed, Jul 1, 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.Wed, Jul 1, 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.Thu, Jul 2, 10:14 AM