Clothing materials: describe the stitch layer #193

Manually merged
github merged 1 commit from gh-pr/193/head into gh-pr/193/base 2026-11-26 20:17:00 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 18:58 UTC · original
holdmysocks:claude/stitch-layer → master · +93 −1 · 3 files · 1 commits · merged 2026-11-24 19:18 UTC

What

A clothing material's record in model.json and materials.json gets a stitches block. The game draws seam stitches from one shared mask texture, sampled with the mesh's third UV set. The block says where a garment's stitches are and how the shader colours them. Nothing is drawn or baked yet.

  • uv_set: TEXCOORD_2.
  • vertices, on_stitch_columns, per_column, v_range_on_columns, has_stitches: measured on the material's own vertices.
  • mask: the shared texture's hash, size, sampling, the U ranges of its three stitch columns and its channels as decoded.
  • weight, colour: the maths read from the shader code.
  • source, not_decoded.

Checked

  • Six garments (t-shirt, jacket, hoodie, blouse, board shorts, biker pants): vertices without stitches rest in an empty gap between the mask's columns on all six; the shorts have every vertex there. Seam vertices lie on the columns with V running along the seam.
  • A real export with this build: the shorts report no stitches, the t-shirt 204 of 3,207 vertices on the middle column.
  • cargo test -p sixng-core --lib: 178 passed.

Not decoded

  • Which mask channels are the grey value and the two tint masks. The weight channel is taken from the data (the only channel that is 0 where vertices without stitches rest); the shader code names a different channel, so the channel order of this texture's format is not settled.
  • The stitch normal map.
  • The stitch amount and tints of a lone model: they are in its material library preset, which the model does not name.
  • Weight and colour maths come from one pixel program, read once. Not compared with a rendered image.
**@⁠holdmysocks** on GitHub · 2026-11-24 18:58 UTC · [original](https://github.com/holdmysocks/SixNG/pull/193) `holdmysocks:claude/stitch-layer` → `master` · +93 −1 · 3 files · 1 commits · merged 2026-11-24 19:18 UTC ## What A clothing material's record in `model.json` and `materials.json` gets a `stitches` block. The game draws seam stitches from one shared mask texture, sampled with the mesh's third UV set. The block says where a garment's stitches are and how the shader colours them. Nothing is drawn or baked yet. - `uv_set`: `TEXCOORD_2`. - `vertices`, `on_stitch_columns`, `per_column`, `v_range_on_columns`, `has_stitches`: measured on the material's own vertices. - `mask`: the shared texture's hash, size, sampling, the U ranges of its three stitch columns and its channels as decoded. - `weight`, `colour`: the maths read from the shader code. - `source`, `not_decoded`. ## Checked - Six garments (t-shirt, jacket, hoodie, blouse, board shorts, biker pants): vertices without stitches rest in an empty gap between the mask's columns on all six; the shorts have every vertex there. Seam vertices lie on the columns with V running along the seam. - A real export with this build: the shorts report no stitches, the t-shirt 204 of 3,207 vertices on the middle column. - `cargo test -p sixng-core --lib`: 178 passed. ## Not decoded - Which mask channels are the grey value and the two tint masks. The weight channel is taken from the data (the only channel that is 0 where vertices without stitches rest); the shader code names a different channel, so the channel order of this texture's format is not settled. - The stitch normal map. - The stitch amount and tints of a lone model: they are in its material library preset, which the model does not name. - Weight and colour maths come from one pixel program, read once. Not compared with a rendered image.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:16:57 +00:00
github manually merged commit 2a3b17f3d9 into gh-pr/193/base 2026-11-26 20:17:00 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.