simplify: Use error returned by vertex quadrics to guide pruning #787
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When attributes are incorporated into the metric, depending on the attribute weights we may see divergence between the error as returned by vertex quadrics alone and the result. Especially when the simplification does not have a set limit, this may lead to unexpectedly aggressive component pruning.
While ideally pruning should only be used with a reasonable error limit that negates these concerns, for now it is probably better to accomodate this use case by tracking the positional error separately.
To reduce the cost of tracking this error we recompute it as collapses are performed; this may seem counter-intuitive since we've already computed it during ranking, but conserving memory is more important here, and since we only need to do it when using attributes and only for collapses we end up taking, the performance cost ends up being negligible.
Cleanup passes that prune components update the error for consistency, even though we will not use it at this point; this can help if we decide to log the error during tracing or return it to caller.
This contribution is sponsored by Valve.