Heads: export the wrinkle region masks and the face region mask (#133) #141

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

@⁠holdmysocks on GitHub · 2026-11-24 12:26 UTC · original
holdmysocks:claude/head-extra-maps → master · +162 −18 · 5 files · 1 commits · merged 2026-11-24 12:36 UTC

Part of #133 (the first half: extra head maps). The readable material file is a separate change.

What was found

  • A head model binds no textures. Its face comes from a material preset, and that preset stores a colour texture and a normal map only. There is no roughness, specular or detail texture for heads in the material data.
  • A preset inherits from a template preset (TemplateName; the male and female base heads for nearly all). The template's asset has a keyed texture list (b70a22c1) with three entries:
    • e12585d1: wrinkle region masks, one BC1 array of 3 slices (512 x 512) shared by every head. Each colour channel of each slice marks one face region (9 regions).
    • 85858f5e: a face region mask (BC1, 1024 x 512, shared): red on brows, eyelids, nose bridge and chin, green on cheeks and neck, blue around the mouth.
    • 2633887d: one more map per sex, and one each for about 60 named characters. None of them is in any texture store of the install. Probably the wrinkle normal map that the masks blend in (a guess).
  • The head normal map is a plain BC5 map (512 x 1024); nothing is packed into it.

What changed

  • The head-skin table (head_skins.json, version 3) keeps the keyed textures per face, a preset's own entries before its template chain's. 1,291 of 1,300 faces have them.
  • A head export writes the two textures that exist beside the face and lists all three in model.json: in the material's textures (the key as param_hash, with a description as slot_role) and in head_skin.extra_textures (with in_game_files). Every slice of the wrinkle mask array is written (<hash>_s0.png ...).
  • The GLB material is unchanged (colour and normal): no shader slot is known for these textures.
  • Fix: the family labels of ped_standard_head (379efcef) and ped_standard_eye (89a1cf72) were swapped.

Checked

  • Export of cs_andrea_head_fr1_lat_000_m_full and head_fr1_cau_017_m_full from the game data: both textures written, three slices, the third listed as "not in any ttpf store"; GLB images unchanged.
  • cargo test -p sixng-core: 152 passed (one new test for the template chain).

Not decoded

  • The names of the three keys, and which shader slot each feeds.
  • What the game binds at run time to the head shader's other slots (speculartex, speculartex2, materialctexture, diffusetexanimatedblend, three unnamed).
  • The preset's Material reference (set on the templates) is in no store either.
  • The viewer does not use the new textures.
**@⁠holdmysocks** on GitHub · 2026-11-24 12:26 UTC · [original](https://github.com/holdmysocks/SixNG/pull/141) `holdmysocks:claude/head-extra-maps` → `master` · +162 −18 · 5 files · 1 commits · merged 2026-11-24 12:36 UTC Part of #133 (the first half: extra head maps). The readable material file is a separate change. ## What was found - A head model binds no textures. Its face comes from a material preset, and that preset stores a colour texture and a normal map only. There is **no roughness, specular or detail texture for heads** in the material data. - A preset inherits from a template preset (`TemplateName`; the male and female base heads for nearly all). The template's asset has a keyed texture list (`b70a22c1`) with three entries: - `e12585d1`: **wrinkle region masks**, one BC1 array of 3 slices (512 x 512) shared by every head. Each colour channel of each slice marks one face region (9 regions). - `85858f5e`: a **face region mask** (BC1, 1024 x 512, shared): red on brows, eyelids, nose bridge and chin, green on cheeks and neck, blue around the mouth. - `2633887d`: one more map per sex, and one each for about 60 named characters. **None of them is in any texture store of the install.** Probably the wrinkle normal map that the masks blend in (a guess). - The head normal map is a plain BC5 map (512 x 1024); nothing is packed into it. ## What changed - The head-skin table (`head_skins.json`, version 3) keeps the keyed textures per face, a preset's own entries before its template chain's. 1,291 of 1,300 faces have them. - A head export writes the two textures that exist beside the face and lists all three in `model.json`: in the material's `textures` (the key as `param_hash`, with a description as `slot_role`) and in `head_skin.extra_textures` (with `in_game_files`). Every slice of the wrinkle mask array is written (`<hash>_s0.png` ...). - The GLB material is unchanged (colour and normal): no shader slot is known for these textures. - Fix: the family labels of `ped_standard_head` (`379efcef`) and `ped_standard_eye` (`89a1cf72`) were swapped. ## Checked - Export of `cs_andrea_head_fr1_lat_000_m_full` and `head_fr1_cau_017_m_full` from the game data: both textures written, three slices, the third listed as "not in any ttpf store"; GLB images unchanged. - `cargo test -p sixng-core`: 152 passed (one new test for the template chain). ## Not decoded - The names of the three keys, and which shader slot each feeds. - What the game binds at run time to the head shader's other slots (`speculartex`, `speculartex2`, `materialctexture`, `diffusetexanimatedblend`, three unnamed). - The preset's `Material` reference (set on the templates) is in no store either. - The viewer does not use the new textures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:12:55 +00:00
github manually merged commit f6b3f8f4a7 into gh-pr/141/base 2026-11-26 20:12:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.