Clothing stitches: name the real stitch atlas and correct the description #202

Manually merged
github merged 2 commits from gh-pr/202/head into gh-pr/202/base 2026-11-26 20:17:46 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 20:26 UTC · original
holdmysocks:claude/stitch-atlas → master · +58 −48 · 2 files · 2 commits · merged 2026-11-24 20:45 UTC

The stitches block added in PR 193 named the wrong texture. This corrects it.

What was wrong

PR 193 took a 128 x 128 mask from the graphics texture store as the stitch texture, because garments' third UV set seemed to fit its three columns. Its channels never fitted the shader code (the weight channel was not 0 off the stitches), and that was left open.

What is right

  • The game binds the clothing shader's two stitch inputs to the textures named ped_stitches_d (colour and coverage) and ped_stitches_n (normal). A third, ped_stitches_ma, is bound beside them; the program that was read does not sample it.
  • The three are in the global graphics texture dictionary, not in a texture store: 2048 x 128 atlases of stitch styles. extract already exports them by name.
  • Their channels fit the shader code exactly: weight = stitch amount x alpha; green is the grey value for the tint gradients; red and blue are the masks for the second and third tint. The channel-order question is closed: nothing is swapped.

What changes in the export

  • stitches.textures names the three textures and their channels, replacing mask with its store hash and column positions.
  • on_stitch_columns, per_column and v_range_on_columns are gone. New: rest_uv (the most common third-UV point), vertices_at_rest, vertices_on_seams; has_stitches is true when any vertex is away from the rest point.
  • weight and colour state the formulas without the earlier caveat. changed records the correction.

What was checked

  • All six name hashes match (three shader inputs, three texture names).
  • Channel values of the three textures.
  • Third UV set on six garments against the atlas: it is the only set that runs along seams; a garment without stitches has it collapsed to one empty point; on a t-shirt the vertices away from seams are gathered in a small empty patch beside a stitch line.
  • Unit tests pass. One garment re-exported with the new build.

Not decoded

  • The split into resting and seam vertices is rough (distance from the most common UV), not a per-pixel test against the atlas. V's direction was not checked.
  • Which preset supplies a lone model's stitch amount and tints, and the default amount.
  • What ped_stitches_ma is used for.
  • Nothing is drawn or compared with a game image.
**@⁠holdmysocks** on GitHub · 2026-11-24 20:26 UTC · [original](https://github.com/holdmysocks/SixNG/pull/202) `holdmysocks:claude/stitch-atlas` → `master` · +58 −48 · 2 files · 2 commits · merged 2026-11-24 20:45 UTC The `stitches` block added in PR 193 named the wrong texture. This corrects it. ## What was wrong PR 193 took a 128 x 128 mask from the graphics texture store as the stitch texture, because garments' third UV set seemed to fit its three columns. Its channels never fitted the shader code (the weight channel was not 0 off the stitches), and that was left open. ## What is right - The game binds the clothing shader's two stitch inputs to the textures named `ped_stitches_d` (colour and coverage) and `ped_stitches_n` (normal). A third, `ped_stitches_ma`, is bound beside them; the program that was read does not sample it. - The three are in the global graphics texture dictionary, not in a texture store: 2048 x 128 atlases of stitch styles. `extract` already exports them by name. - Their channels fit the shader code exactly: weight = stitch amount x alpha; green is the grey value for the tint gradients; red and blue are the masks for the second and third tint. The channel-order question is closed: nothing is swapped. ## What changes in the export - `stitches.textures` names the three textures and their channels, replacing `mask` with its store hash and column positions. - `on_stitch_columns`, `per_column` and `v_range_on_columns` are gone. New: `rest_uv` (the most common third-UV point), `vertices_at_rest`, `vertices_on_seams`; `has_stitches` is true when any vertex is away from the rest point. - `weight` and `colour` state the formulas without the earlier caveat. `changed` records the correction. ## What was checked - All six name hashes match (three shader inputs, three texture names). - Channel values of the three textures. - Third UV set on six garments against the atlas: it is the only set that runs along seams; a garment without stitches has it collapsed to one empty point; on a t-shirt the vertices away from seams are gathered in a small empty patch beside a stitch line. - Unit tests pass. One garment re-exported with the new build. ## Not decoded - The split into resting and seam vertices is rough (distance from the most common UV), not a per-pixel test against the atlas. V's direction was not checked. - Which preset supplies a lone model's stitch amount and tints, and the default amount. - What `ped_stitches_ma` is used for. - Nothing is drawn or compared with a game image.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:17:43 +00:00
github manually merged commit 7461d28b1f into gh-pr/202/base 2026-11-26 20:17:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.