Viewer: under-layers stay behind the clothes over them on a reshaped body #407

Manually merged
github merged 2 commits from github-bot/gh-407 into gh-pr/407/base 2026-11-27 00:40:03 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-26 20:06 UTC · original
holdmysocks:claude/people-shape-poke → master · +103 −0 · 1 files · 2 commits · merged 2026-11-26 21:33 UTC

Viewer: on a reshaped body (the weight and muscle sliders), clothes worn under other clothes stay behind them. Before, the t-shirt under cs_tal_bu's open shirt came through at the chest pockets and the button strip, and cs_andrea's tank top came through her bomber jacket.

Cause: with a body shape, each garment follows the skin on its own: each vertex moves with its nearest skin points and is pushed out along its own normal where the skin swells. Two layers a centimetre apart get slightly different offsets, so the inner one can come out in front.

Change (keep_layer_order in model_view.rs):

  • Each garment's positions from before the shaping are kept.
  • After the merge, for every level of clothes inside out, each vertex of the inner garment is checked against the garments over it.
  • If on the neutral body it lay behind an outer garment's surface, it is put back as far behind as it was. The check uses outer vertices within 6 cm and at most 2 cm to the side, plus the nearest outer vertex. With several outer surfaces, the largest push wins.
  • The outer normal is turned to face the way the inner vertex does, so a two-sided garment's inner face counts too. Vertices only move inward.
  • A viewer note gives how many vertices moved.

Verified:

  • cargo test --release --locked -p sixng-gui passes.
  • Renders of cs_tal_bu, cs_andrea and cs_roxy at weight 1 and muscle 1, before and after:
    • cs_tal_bu: the t-shirt patches at both pockets and the button strip are gone.
    • cs_andrea: the tank top along the jacket's zip edge is gone, and the two patches at the chest are much smaller.
    • cs_roxy: no change visible.
  • Neutral bodies (--body 0,0) render pixel-identical to the viewer before this change, and the pass moves no vertices there.

Not done:

  • Two small tank-top spots remain on cs_andrea's chest at full weight. White flecks on her belt at full weight are unchanged and were there before. They stay when the tank top is left out, so they're the jeans clipping through themselves (each mesh of a garment follows the skin on its own). Ordering one garment's meshes against each other the same way was tried and tears seams, so it's left out.
  • Garments at the same level (a tank top and jeans) are not ordered against each other. Tried; it changed nothing visible on these characters.
  • The game's own data for shaping clothes is still not decoded; this keeps the viewer's skin-following approach.
  • The CLI export doesn't move clothes with the skin (that's viewer-only), so it's unaffected.
**@⁠holdmysocks** on GitHub · 2026-11-26 20:06 UTC · [original](https://github.com/holdmysocks/SixNG/pull/407) `holdmysocks:claude/people-shape-poke` → `master` · +103 −0 · 1 files · 2 commits · merged 2026-11-26 21:33 UTC Viewer: on a reshaped body (the weight and muscle sliders), clothes worn under other clothes stay behind them. Before, the t-shirt under cs_tal_bu's open shirt came through at the chest pockets and the button strip, and cs_andrea's tank top came through her bomber jacket. **Cause:** with a body shape, each garment follows the skin on its own: each vertex moves with its nearest skin points and is pushed out along its own normal where the skin swells. Two layers a centimetre apart get slightly different offsets, so the inner one can come out in front. **Change** (`keep_layer_order` in model_view.rs): - Each garment's positions from before the shaping are kept. - After the merge, for every level of clothes inside out, each vertex of the inner garment is checked against the garments over it. - If on the neutral body it lay behind an outer garment's surface, it is put back as far behind as it was. The check uses outer vertices within 6 cm and at most 2 cm to the side, plus the nearest outer vertex. With several outer surfaces, the largest push wins. - The outer normal is turned to face the way the inner vertex does, so a two-sided garment's inner face counts too. Vertices only move inward. - A viewer note gives how many vertices moved. **Verified:** - `cargo test --release --locked -p sixng-gui` passes. - Renders of cs_tal_bu, cs_andrea and cs_roxy at weight 1 and muscle 1, before and after: - cs_tal_bu: the t-shirt patches at both pockets and the button strip are gone. - cs_andrea: the tank top along the jacket's zip edge is gone, and the two patches at the chest are much smaller. - cs_roxy: no change visible. - Neutral bodies (`--body 0,0`) render pixel-identical to the viewer before this change, and the pass moves no vertices there. **Not done:** - Two small tank-top spots remain on cs_andrea's chest at full weight. White flecks on her belt at full weight are unchanged and were there before. They stay when the tank top is left out, so they're the jeans clipping through themselves (each mesh of a garment follows the skin on its own). Ordering one garment's meshes against each other the same way was tried and tears seams, so it's left out. - Garments at the same level (a tank top and jeans) are not ordered against each other. Tried; it changed nothing visible on these characters. - The game's own data for shaping clothes is still not decoded; this keeps the viewer's skin-following approach. - The CLI export doesn't move clothes with the skin (that's viewer-only), so it's unaffected.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:45:41 +00:00
github-bot changed target branch from master to gh-pr/407/base 2026-11-27 00:40:01 +00:00
github manually merged commit be5adc424e into gh-pr/407/base 2026-11-27 00:40:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.