Rigged vertex welding: weld nearby verts across meshes on the same avatar (close seams, shared normals) #574

Closed
opened 2026-10-09 00:24:42 +00:00 by sky_line · 1 comment
Owner

Mesh avatars are assembled from separate rigged meshes: body, head, hands, feet, add-ons, and BOM/mesh parts from different creators. Where they meet, the vertices sit at almost the same position, but each mesh shades with its own normals. The result is visible seams: a lighting discontinuity, hairline gaps that open under animation, and shadow and AO lines.

Goal

After skinning, weld vertices rigged to the same avatar that lie within a small distance of each other:

  • give them a shared position, so gaps close;
  • give them a shared normal (and tangent), so the shading flows across the join.

Proposed approach

  1. Find weld candidates once, at bind time.
    • Per avatar, take the open-boundary vertices of each rigged mesh (edges used by only one triangle) in the bind pose.
    • Spatial-hash them, and pair vertices from different meshes (optionally the same mesh across UV seams) that are within epsilon of each other.
    • Make epsilon a setting, around 1–2 mm in bind space.
    • Optionally require similar joint weights, so the pair stays together under animation.
    • Rebuild the pairs when the avatar's rigged attachment set, shape or LOD changes, not every frame.
  2. Weld each frame in a compute pass after the pre-skin pass, before draw, shadow, RT and AO consume the skinned vertices. For each weld group:
    • average the skinned positions;
    • average the normals, but only when the angle between them is below a threshold (keep deliberate hard edges);
    • re-orthogonalise the tangents, keeping each vertex's own handedness;
    • leave UVs untouched.
  3. Scope.
    • Only within one avatar or animesh; never across avatars or onto static geometry.
    • Opt-out per avatar/attachment if a creator relies on the gap.
    • Global setting, plus a debug view that highlights welded vertices.
  4. Cost and VRAM.
    • Weld groups are small and only on boundaries, so a compact index list per avatar should be enough.
    • Keep the stores bounded, with stats (live/cap/peak).

Interactions

  • Pre-skin output format: see #573 quantized geometry.
  • Decimated rigged LODs (#561): weld groups must be per LOD, or remapped.
  • Rigged shadow casters (#564) and RT rigged BLAS should see the welded positions.
  • Earlier welded-part seams were traced to material routing (some faces of a part going down the legacy path, others down PBR). Welding fixes the geometric and normal discontinuity, not a material mismatch.

Done when

  • A head–neck or body–hands seam on a multi-creator avatar shows no lighting line and no gap under animation.
  • No visible change on single-mesh avatars.
  • Frame cost is negligible at a crowded venue.
Mesh avatars are assembled from separate rigged meshes: body, head, hands, feet, add-ons, and BOM/mesh parts from different creators. Where they meet, the vertices sit at almost the same position, but each mesh shades with its own normals. The result is visible seams: a lighting discontinuity, hairline gaps that open under animation, and shadow and AO lines. ## Goal After skinning, weld vertices rigged to the **same avatar** that lie within a small distance of each other: - give them a shared position, so gaps close; - give them a shared normal (and tangent), so the shading flows across the join. ## Proposed approach 1. **Find weld candidates once, at bind time.** - Per avatar, take the open-boundary vertices of each rigged mesh (edges used by only one triangle) in the bind pose. - Spatial-hash them, and pair vertices from *different* meshes (optionally the same mesh across UV seams) that are within epsilon of each other. - Make epsilon a setting, around 1–2 mm in bind space. - Optionally require similar joint weights, so the pair stays together under animation. - Rebuild the pairs when the avatar's rigged attachment set, shape or LOD changes, not every frame. 2. **Weld each frame in a compute pass** after the pre-skin pass, before draw, shadow, RT and AO consume the skinned vertices. For each weld group: - average the skinned positions; - average the normals, but only when the angle between them is below a threshold (keep deliberate hard edges); - re-orthogonalise the tangents, keeping each vertex's own handedness; - leave UVs untouched. 3. **Scope.** - Only within one avatar or animesh; never across avatars or onto static geometry. - Opt-out per avatar/attachment if a creator relies on the gap. - Global setting, plus a debug view that highlights welded vertices. 4. **Cost and VRAM.** - Weld groups are small and only on boundaries, so a compact index list per avatar should be enough. - Keep the stores bounded, with stats (live/cap/peak). ## Interactions - Pre-skin output format: see #573 quantized geometry. - Decimated rigged LODs (#561): weld groups must be per LOD, or remapped. - Rigged shadow casters (#564) and RT rigged BLAS should see the welded positions. - Earlier welded-part seams were traced to material routing (some faces of a part going down the legacy path, others down PBR). Welding fixes the geometric and normal discontinuity, not a material mismatch. ## Done when - A head–neck or body–hands seam on a multi-creator avatar shows no lighting line and no gap under animation. - No visible change on single-mesh avatars. - Frame cost is negligible at a crowded venue.
sky_line added this to the Slipstream project 2026-10-09 00:24:43 +00:00
Author
Owner

Done: e1995f514a (rigged vertex welding on the GPU after the pre-skin), 67e32ca5ce (fixed a GPU device-lost when rigged buffers resized with welding on), 3706b43972 (Preferences > Advanced > Weld avatar mesh seams). Off by default. Verified by the owner. Lands in 1.2.0 Beta 8.

Done: e1995f514a (rigged vertex welding on the GPU after the pre-skin), 67e32ca5ce (fixed a GPU device-lost when rigged buffers resized with welding on), 3706b43972 (Preferences > Advanced > Weld avatar mesh seams). Off by default. Verified by the owner. Lands in 1.2.0 Beta 8.
sky_line 2026-10-09 22:36:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#574
No description provided.