Viewer: characters' hair takes the colours of its hair preset #203

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

@⁠holdmysocks on GitHub · 2026-11-24 20:30 UTC · original
holdmysocks:claude/people-hair-colour → master · +307 −10 · 5 files · 1 commits · merged 2026-11-24 20:55 UTC

What

Story characters' hair was drawn in the viewer's default dark colour, because their hair items store no usable tint (placeholder palette, rows 0, 0, 0).

The colour is elsewhere: a hair, brow, lash or beard item names a hair colour preset (wardrobe tag f7b14eb8, on the item or a parent) in the appearance library of data.rpf (records of struct 6f03dd54, 121 of them). A preset has two colours, an optional noise texture and seven numbers.

Changes

  • New hairtone module: reads the presets (cached as hair_presets.json in the work directory's index folder), the display mapping and the per-strand mix.
  • ped-look and the wardrobe parts carry hair_preset.
  • Viewer: each groom of a character takes its item's preset. Strands mix the two colours by the preset's noise texture at the strand's root UV, or by a per-strand scatter when the preset names no texture. A "stored hair colours" checkbox turns it off (then the one picker colour applies, as before).

Measured

  • 196 hair items of 70 story characters: all name a preset; none stores a tint of its own. They use 9 of the 121 presets.
  • Presets used by story characters are dark, low values (black 1, 1, 1; brown about 19, 13, 10). Others are blonde, red, orange, green and teal. 87 presets are white with a flag set; these are skipped.
  • 13 presets name one of two 256 x 256 noise textures.

Not decoded (stated in the code and the tooltip)

  • How the game mixes the two colours: the noise mix is an inference from the preset naming a noise texture and a tiling-like number.
  • What the seven numbers are.
  • Display: the stored values are shown brighter (square root per channel), because the game's hair shader scatters light and the viewer's does not. This is a display choice.

Verified

  • cargo test --release --workspace: 191 and 20 pass (2 new tests).
  • One character rendered in the viewer on the RTX 4080: hair and brows take their presets and show a mix of two tones.

Not verified against the game: the exact look (brightness and where each colour falls).

**@⁠holdmysocks** on GitHub · 2026-11-24 20:30 UTC · [original](https://github.com/holdmysocks/SixNG/pull/203) `holdmysocks:claude/people-hair-colour` → `master` · +307 −10 · 5 files · 1 commits · merged 2026-11-24 20:55 UTC ## What Story characters' hair was drawn in the viewer's default dark colour, because their hair items store no usable tint (placeholder palette, rows 0, 0, 0). The colour is elsewhere: a hair, brow, lash or beard item names a **hair colour preset** (wardrobe tag `f7b14eb8`, on the item or a parent) in the appearance library of data.rpf (records of struct `6f03dd54`, 121 of them). A preset has two colours, an optional noise texture and seven numbers. ## Changes - New `hairtone` module: reads the presets (cached as `hair_presets.json` in the work directory's index folder), the display mapping and the per-strand mix. - `ped-look` and the wardrobe parts carry `hair_preset`. - Viewer: each groom of a character takes its item's preset. Strands mix the two colours by the preset's noise texture at the strand's root UV, or by a per-strand scatter when the preset names no texture. A "stored hair colours" checkbox turns it off (then the one picker colour applies, as before). ## Measured - 196 hair items of 70 story characters: all name a preset; none stores a tint of its own. They use 9 of the 121 presets. - Presets used by story characters are dark, low values (black 1, 1, 1; brown about 19, 13, 10). Others are blonde, red, orange, green and teal. 87 presets are white with a flag set; these are skipped. - 13 presets name one of two 256 x 256 noise textures. ## Not decoded (stated in the code and the tooltip) - How the game mixes the two colours: the noise mix is an inference from the preset naming a noise texture and a tiling-like number. - What the seven numbers are. - Display: the stored values are shown brighter (square root per channel), because the game's hair shader scatters light and the viewer's does not. This is a display choice. ## Verified - `cargo test --release --workspace`: 191 and 20 pass (2 new tests). - One character rendered in the viewer on the RTX 4080: hair and brows take their presets and show a mix of two tones. Not verified against the game: the exact look (brightness and where each colour falls).
A hair, brow, lash or beard item names a hair colour preset (wardrobe tag
f7b14eb8) in the appearance library of data.rpf: 121 records with two
colours, an optional noise texture and seven numbers. The item's own tint
bytes are placeholders on story characters, so their hair was drawn in the
viewer's default dark colour.

- hairtone: reads the presets (cached in the work directory), with the
  display mapping and the per-strand mix.
- wardrobe / ped-look: parts carry hair_preset.
- viewer: each groom of a character takes its item's preset; strands mix
  the two colours by the preset's noise texture at the root UV (per-strand
  scatter when it names none). A checkbox turns it off.

How the game mixes the two colours and what the seven numbers are is not
decoded; the mix and the brighter display are the viewer's choices and say
so.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:17:49 +00:00
github manually merged commit 45d34d8c5f into gh-pr/203/base 2026-11-26 20:17:51 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.