Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify: Split quadrics update into a separate function #788

Merged
merged 3 commits into from
Oct 11, 2024
Merged

Commits on Oct 10, 2024

  1. simplify: Split quadrics update into a separate function

    Instead of updating quadrics as we are collapsing edges, we can update
    them in batch after all collapses are done. This makes the code cleaner
    since we do not need to replicate the collapse structure explicitly for
    both remap and quadric update, and also makes it ~5% faster on many
    large meshes - presumably due to better data locality during the update.
    
    The only subtle part here is vertex_quadrics update: we need to do this
    just once, and we *know* the primary vertex will have to move if any
    wedge moved, so we do that during the corresponding collapse. The
    target vertex may not have had any collapses to the primary vertex in
    case some vertex gets collapsed into a locked vertex.
    
    This change results in exactly identical results; in the future, this
    would result in a more careful handling of Complex collapses as our note
    about the attribute quadrics not requiring a merge was incorrect - even
    though the attributes might be similar, merging quadrics is still
    valuable to get area accumulation.
    zeux committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    82cf778 View commit details
    Browse the repository at this point in the history
  2. simplify: Move vertex_error update to updateQuadrics

    This way performEdgeCollapses no longer needs access to quadrics data,
    and when attributes are used and we need to compute distance error, the
    access to vertex quadrics is maximally local as we use them right after
    aggregation, which saves 1-2% on large meshes.
    
    For now we keep the optimization of not recomputing the distance error
    unless attributes are used; it makes the data flow slightly awkward and
    seems to have <1% performance impact but we can remove it later if it
    becomes more problematic.
    zeux committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    990eb2a View commit details
    Browse the repository at this point in the history
  3. simplify: Move seam pair computation into collapse handling

    The only reason why seam pair was computed separately was to reuse that
    computation between collapse and quadric updates as it is fragile; now
    that we have split quadric updates completely, sx is only used for
    collapse update and it's thus better and cheaper to process inline.
    zeux committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    e4144c2 View commit details
    Browse the repository at this point in the history