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: Improve vertex_lock handling in presence of seams #779

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Conversation

zeux
Copy link
Owner

@zeux zeux commented Oct 2, 2024

In the previous implementation from #601, we would only read vertex_lock
data for the primary vertex (the vertex with the smallest index among those
with the same position). When using sparse mode, this would be the first
vertex referenced by the index buffer due to how the sparse remap works.

If the input locks were inconsistent between all copies, there could be
a situation where a vertex with the wrong index was asked to be locked,
and the vertex would still be not-locked and could move. When not
using sparse mode, this was particularly problematic as the flags would
be read from the vertex that might not be referenced by the index buffer
at all.

We now propagate the locked status into the primary vertex in a separate
pass; this requires re-locking the wedges in a separate pass, but all of
this is very quick especially when using sparse mode. Locking any vertex
copy is now thus sufficient to lock the vertex (when using sparse mode,
locking any copy referenced by the index buffer is sufficient; by design,
sparse mode ignores any data from vertices that aren't referenced by
the index buffer).

This contribution is sponsored by Valve.

Previously, we would only read vertex_lock data for the primary vertex
(the vertex with the smallest index among those with the same position).
When using sparse mode, this would be the first vertex referenced by the
index buffer due to how the sparse remap works.

If the input locks were inconsistent between all copies, there could be
a situation where a vertex with the wrong index was asked to be locked,
and the vertex would still be not-locked and could move. When *not*
using sparse mode, this was particularly problematic as the flags would
be read from the vertex that might not be referenced by the index buffer
at all.

We now propagate the locked status into the primary vertex in a separate
pass; this requires re-locking the wedges in a separate pass, but all of
this is very quick especially when using sparse mode.
This test would fail before, specifically lock2 would not lock the spine
because it was using the side of the spine with larger vertex indices;
after the previous fix lock2 and lock3 are equivalent.
@zeux zeux merged commit 1c8e968 into master Oct 3, 2024
12 checks passed
@zeux zeux deleted the simp-vlock branch October 3, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant