Body, hand and feet skin spec maps from the wardrobe material assets (#392, part 1) #435

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

@⁠holdmysocks on GitHub · 2026-11-27 02:15 UTC · original
holdmysocks:people-skin-rma → master · +353 −1 · 5 files · 2 commits · merged 2026-11-27 03:11 UTC

First half of #392: the spec maps of the body, hand and feet skins.

What the game binds. The skin shader (ped_standard_skin, and ped_standard_lod_skin) has two spec slots, speculartex (c6f46e79) and speculartex2 (739e3d0d). It has no separate roughness or metalness texture. On every main hand_* and feet_* mesh of every fit, both slots bind placeholders that are in no store; only the normal map is stored.

Where they come from. They come neither from shader-archive defaults nor from the mesh's material params. Each texture state of a wardrobe item names a Material asset id beside its colour and normal map. The material assets are 47 PSO asset sets in packs.rpf. Each record lists its textures by key: 179eb44a is speculartex and 4cf41ef4 is speculartex2. On the stored first-person hands, the record names exactly the maps that mesh binds.

Change

  • New skinspec table: colour map → material → spec maps. It is built from the packs.rpf index on first use and cached as <work>/index/skin_spec.json. It has 6,793 materials and 2,639 colour maps. Ten colour maps that name more than one material (shared defaults) are left out instead of guessed.
  • The outfit and model exports put the maps into the placeholder slots of body, hand and feet meshes, and of heads where the face's material has them. Each part's skin record in model.json gets a spec entry.
  • The maps go into the GLB as stored: material extras and PNGs, so they show in the viewer's slot list and texture-slot view.
  • Slot roles for both skin shaders, and a README paragraph.

Channels (read from the skin pixel program PS_DeferredPedTexturedNC, second commit). There is no metalness.

  • speculartex R: a translucency mask. saturate(R - c) goes to a G-buffer target of its own; it is non-zero only on thin parts such as the finger segments.
  • speculartex G: roughness, about 0.6 on skin. Overlay layers blend it toward their own value and the detail map adjusts it; after a view-dependent factor and specular anti-aliasing, the G-buffer stores 1 - roughness.
  • speculartex B: occlusion, lerp(1, B, strength), stored in 6 bits. It is mostly 1.
  • speculartex2 R: the detail strength mask.
  • speculartex2 G: the skin region, 16 x G (high nibble, 0-15). Stored values are 16k + 5..7. A per-draw table turns the region into a layer of the detail normal and detail control atlases (0cd27763, 7c0055b9).

The GLB still carries the maps as stored and does not map them to glTF roughness or occlusion yet. The viewer's default shading is unchanged.

Checks

  • cargo test -p sixng-core: 337 passed. New tests cover material records, wardrobe asset links and leaving shared colour maps out.
  • Lucia (cs_lucia --look 0): hand gets 9c4d3d0582891fbc / c603b049c4fbfa5b, feet get 9baf566e90f2368a / e24a520be7f4f5cf. The hand map's layout matches the colour atlas (fingers, nails, upper body).
  • Jason (cs_jason --look 0): hand, feet, body and teeth all get both maps.
  • Viewer on the RTX 4080: the texture-slot view shows the maps on body, hands and legs in the right places. The shaded render is unchanged.

Linear: SIX-241.

**@⁠holdmysocks** on GitHub · 2026-11-27 02:15 UTC · [original](https://github.com/holdmysocks/SixNG/pull/435) `holdmysocks:people-skin-rma` → `master` · +353 −1 · 5 files · 2 commits · merged 2026-11-27 03:11 UTC First half of #392: the spec maps of the body, hand and feet skins. **What the game binds.** The skin shader (`ped_standard_skin`, and `ped_standard_lod_skin`) has two spec slots, `speculartex` (`c6f46e79`) and `speculartex2` (`739e3d0d`). It has no separate roughness or metalness texture. On every main `hand_*` and `feet_*` mesh of every fit, both slots bind placeholders that are in no store; only the normal map is stored. **Where they come from.** They come neither from shader-archive defaults nor from the mesh's material params. Each texture state of a wardrobe item names a `Material` asset id beside its colour and normal map. The material assets are 47 PSO asset sets in `packs.rpf`. Each record lists its textures by key: `179eb44a` is `speculartex` and `4cf41ef4` is `speculartex2`. On the stored first-person hands, the record names exactly the maps that mesh binds. **Change** - New `skinspec` table: colour map → material → spec maps. It is built from the packs.rpf index on first use and cached as `<work>/index/skin_spec.json`. It has 6,793 materials and 2,639 colour maps. Ten colour maps that name more than one material (shared defaults) are left out instead of guessed. - The outfit and model exports put the maps into the placeholder slots of body, hand and feet meshes, and of heads where the face's material has them. Each part's skin record in `model.json` gets a `spec` entry. - The maps go into the GLB as stored: material `extras` and PNGs, so they show in the viewer's slot list and texture-slot view. - Slot roles for both skin shaders, and a README paragraph. **Channels (read from the skin pixel program `PS_DeferredPedTexturedNC`, second commit).** There is no metalness. - `speculartex` R: a translucency mask. `saturate(R - c)` goes to a G-buffer target of its own; it is non-zero only on thin parts such as the finger segments. - `speculartex` G: roughness, about 0.6 on skin. Overlay layers blend it toward their own value and the detail map adjusts it; after a view-dependent factor and specular anti-aliasing, the G-buffer stores 1 - roughness. - `speculartex` B: occlusion, `lerp(1, B, strength)`, stored in 6 bits. It is mostly 1. - `speculartex2` R: the detail strength mask. - `speculartex2` G: the skin region, `16 x G` (high nibble, 0-15). Stored values are 16k + 5..7. A per-draw table turns the region into a layer of the detail normal and detail control atlases (`0cd27763`, `7c0055b9`). The GLB still carries the maps as stored and does not map them to glTF roughness or occlusion yet. The viewer's default shading is unchanged. **Checks** - `cargo test -p sixng-core`: 337 passed. New tests cover material records, wardrobe asset links and leaving shared colour maps out. - Lucia (`cs_lucia --look 0`): hand gets `9c4d3d0582891fbc` / `c603b049c4fbfa5b`, feet get `9baf566e90f2368a` / `e24a520be7f4f5cf`. The hand map's layout matches the colour atlas (fingers, nails, upper body). - Jason (`cs_jason --look 0`): hand, feet, body and teeth all get both maps. - Viewer on the RTX 4080: the texture-slot view shows the maps on body, hands and legs in the right places. The shaded render is unchanged. Linear: SIX-241.
The skin shader's speculartex and speculartex2 slots bind placeholders
on every main hand_/feet_ mesh. Each wardrobe texture state names a
Material asset id; the material assets (PSO asset sets in packs.rpf)
list the two spec maps under keys 179eb44a and 4cf41ef4. New skinspec
table (colour map -> material -> spec maps, cached in work/index), used
by the outfit and model exports to fill those slots. Shared colour maps
that name more than one material are left out. The maps are carried as
stored; their channel use in the skin program is not decoded.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:26:33 +00:00
speculartex: R translucency mask, G roughness (stored as 1 - roughness),
B occlusion. speculartex2: R detail strength mask, G skin region (high
nibble) that picks the detail normal / control atlas layer. Slot roles,
module docs, export note and README updated.
github-bot changed target branch from master to gh-pr/435/base 2026-11-27 03:15:12 +00:00
github manually merged commit a1f8fe4cc0 into gh-pr/435/base 2026-11-27 03:15:14 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.