Tattoo bake: lay the upper body out in its second UV set #530

Manually merged
github merged 1 commit from github-bot/gh-530 into gh-pr/530/base 2026-11-28 04:38:00 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-28 04:19 UTC · original
holdmysocks:claude/tattoo-uv1-385 → master · +89 −51 · 4 files · 1 commits · merged 2026-11-28 04:32 UTC

Part of #385: tattoo seams on the upper body (Viper's shoulder, and lines stopping at island edges).

Upper-body decorations were baked in the mesh's fourth UV set, at (2 u3, v3). That set halves only the arms by side. The shoulder yoke and the waist strip keep UV0's full width, so the bake stretched them 2x against the arms. As a result, a tattoo that runs from the arm onto the shoulder broke where the islands meet.

The decorations follow the second UV set (TEXCOORD_1) instead. The evidence:

  • Viper's whole-sheet tattoo (one 1024x512 picture with no transform) is painted to TEXCOORD_1's island outlines. The chest piece, the portrait and the "SEVEN" lettering each sit inside one island; TEXCOORD_3's outlines cut through them.
  • Seams. I sampled the sheet at both sides of every seam on the mesh.
    • TEXCOORD_1: mean colour jump 0.022, 6% of seam points jump visibly.
    • TEXCOORD_3: mean jump 0.097, 28% jump visibly.
  • Catalogue. Of all body-upper layers, 81% have their decal centre on the upper body in TEXCOORD_1, against 78% in TEXCOORD_3 and 59% in UV0.
  • Baked results. The same seam test on exported characters gives these mean jumps (TEXCOORD_3 → TEXCOORD_1). The plain skin alone jumps about 0.04 at the same seams.
    • Viper: 0.143 → 0.073
    • Andy: 0.088 → 0.075
    • Mandy: 0.069 → 0.064
    • Guardia: 0.067 → 0.063
  • Andy's back. It now comes out as one symmetric spine piece with a portrait on each shoulder blade. Before, a single portrait sat on the front of the chest.

What changes:

  • peddeco::uv_layout (was uv3_layout) bakes into the layout of any UV set. Gutter texels take the skin of the nearest covered texel, so filtering at an island's edge reads the same skin.
  • The export still recognises an upper body by its fourth set, but bakes it in TEXCOORD_1. The material reads it there through glTF texCoord 1. The record notes describe the space.
  • The viewer gets a material bit for "base colour in the second UV set".
  • The bake rule version is bumped, so cached textures are made again.

Tests: uv_layout reading the base at each texel's UV0, and a gutter taking its nearest island's skin rather than the half-width rule.

Still open on #385:

  • Which stream the game binds to the bake mesh shader's UV slot. The shader reads slot 3, then a per-draw scale, offset and 2x3 transform. The data says the second set; the CPU side isn't traced.
  • One leftover edge on Andy's front (a thorn piece starting at a straight line under her top).
  • Vicki: her game data gives her upper body no decorations at all. Her only body record is for the legs, and its fourth layer lands past the leg mesh's UVs, so the game can't draw it either. Whatever she shows in game comes from elsewhere (a script, like Lucia's set).
**@⁠holdmysocks** on GitHub · 2026-11-28 04:19 UTC · [original](https://github.com/holdmysocks/SixNG/pull/530) `holdmysocks:claude/tattoo-uv1-385` → `master` · +89 −51 · 4 files · 1 commits · merged 2026-11-28 04:32 UTC Part of #385: tattoo seams on the upper body (Viper's shoulder, and lines stopping at island edges). Upper-body decorations were baked in the mesh's fourth UV set, at `(2 u3, v3)`. That set halves only the arms by side. The shoulder yoke and the waist strip keep UV0's full width, so the bake stretched them 2x against the arms. As a result, a tattoo that runs from the arm onto the shoulder broke where the islands meet. The decorations follow the second UV set (TEXCOORD_1) instead. The evidence: - **Viper's whole-sheet tattoo** (one 1024x512 picture with no transform) is painted to TEXCOORD_1's island outlines. The chest piece, the portrait and the "SEVEN" lettering each sit inside one island; TEXCOORD_3's outlines cut through them. - **Seams.** I sampled the sheet at both sides of every seam on the mesh. - TEXCOORD_1: mean colour jump 0.022, 6% of seam points jump visibly. - TEXCOORD_3: mean jump 0.097, 28% jump visibly. - **Catalogue.** Of all body-upper layers, 81% have their decal centre on the upper body in TEXCOORD_1, against 78% in TEXCOORD_3 and 59% in UV0. - **Baked results.** The same seam test on exported characters gives these mean jumps (TEXCOORD_3 → TEXCOORD_1). The plain skin alone jumps about 0.04 at the same seams. - Viper: 0.143 → 0.073 - Andy: 0.088 → 0.075 - Mandy: 0.069 → 0.064 - Guardia: 0.067 → 0.063 - **Andy's back.** It now comes out as one symmetric spine piece with a portrait on each shoulder blade. Before, a single portrait sat on the front of the chest. What changes: - `peddeco::uv_layout` (was `uv3_layout`) bakes into the layout of any UV set. Gutter texels take the skin of the nearest covered texel, so filtering at an island's edge reads the same skin. - The export still recognises an upper body by its fourth set, but bakes it in TEXCOORD_1. The material reads it there through glTF `texCoord` 1. The record notes describe the space. - The viewer gets a material bit for "base colour in the second UV set". - The bake rule version is bumped, so cached textures are made again. Tests: `uv_layout` reading the base at each texel's UV0, and a gutter taking its nearest island's skin rather than the half-width rule. Still open on #385: - Which stream the game binds to the bake mesh shader's UV slot. The shader reads slot 3, then a per-draw scale, offset and 2x3 transform. The data says the second set; the CPU side isn't traced. - One leftover edge on Andy's front (a thorn piece starting at a straight line under her top). - Vicki: her game data gives her upper body no decorations at all. Her only body record is for the legs, and its fourth layer lands past the leg mesh's UVs, so the game can't draw it either. Whatever she shows in game comes from elsewhere (a script, like Lucia's set).
The upper body's decorations follow the islands of TEXCOORD_1, not
TEXCOORD_3: TEXCOORD_3 halves only the arms by side and keeps the
shoulder yoke and waist strip at UV0 width, so (2 u3) stretched them 2x
against the arms and tattoos broke at the island edges. Gutters now take
the nearest covered texel's skin. The GLB and the viewer read the bake
through TEXCOORD_1.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 04:19:50 +00:00
github-bot changed target branch from master to gh-pr/530/base 2026-11-28 04:37:58 +00:00
github manually merged commit 90d83ac4cc into gh-pr/530/base 2026-11-28 04:38:00 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.