People: clothing colours from the garment presets #109

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

@⁠holdmysocks on GitHub · 2026-11-24 03:19 UTC · original
holdmysocks:claude/people-preset-colours → master · +116 −8 · 4 files · 1 commits · merged 2026-11-24 03:24 UTC

Follow-up to #100 and #107. Applies the garment preset colours that #107 decodes to characters in the viewer.

What this does

  • pedlook: an outfit part carries preset_colours, the base colour (sRGB) per sub-material of its item's garment preset, from matlib (ped-look prints them).
  • matlib::Index::load_or_build: builds <work>/index/material_presets.json from the data.rpf index when it is missing, so the viewer does not depend on a sixng materials run.
  • Viewer: each texel of a garment takes the colour of its sub-material, read from the garment's materialid texture (red x 63, as the clothing shader reads it), shaded by the fabric shade as before. A garment without materialid takes the colour of sub-material 0. Preset colours come before the stored state colour, the tint row and the colour tag.

Verified

  • Rendered on the integrated GPU, eight characters: white T-shirt with khaki shorts, a pink T-shirt, a white track jacket over navy trousers, lighter denim shorts, a pale blue shirt, brown sandals. The colours agree with the items' colour tags where they have one (pink, navy, blue, black, grey, white).
  • The same eight are pixel-identical between my first version (own loader) and this one through matlib.
  • cargo test --workspace: 148 core and 12 viewer tests pass.

Not verified / known limits

  • player_story000_00's top and shoes change (black top, dark shoes; a tint row gave red shoes before). Those items have both a preset and a tint row, and what the tint rows do on preset items is not known; which is right was not established.
  • The per-vertex sub-material id is not read: a garment with several sub-materials and no materialid texture is one colour.
  • Not applied: colour entry 1 (the colour the game fades towards), the three-stop gradient over the tiling fabric texture (matlib::stops; the fabric texture is not located), entries 2 and 3.
  • outfit --look exports are unchanged (the colouring is in the viewer).
  • macOS Metal renderer not run.

Files

crates/sixng-core/src/pedlook.rs, matlib.rs (one added function), crates/sixng-gui/src/model_view.rs (character colouring), README.md.

**@⁠holdmysocks** on GitHub · 2026-11-24 03:19 UTC · [original](https://github.com/holdmysocks/SixNG/pull/109) `holdmysocks:claude/people-preset-colours` → `master` · +116 −8 · 4 files · 1 commits · merged 2026-11-24 03:24 UTC Follow-up to #100 and #107. Applies the garment preset colours that #107 decodes to characters in the viewer. ## What this does - `pedlook`: an outfit part carries `preset_colours`, the base colour (sRGB) per sub-material of its item's garment preset, from `matlib` (`ped-look` prints them). - `matlib::Index::load_or_build`: builds `<work>/index/material_presets.json` from the data.rpf index when it is missing, so the viewer does not depend on a `sixng materials` run. - Viewer: each texel of a garment takes the colour of its sub-material, read from the garment's `materialid` texture (red x 63, as the clothing shader reads it), shaded by the fabric shade as before. A garment without `materialid` takes the colour of sub-material 0. Preset colours come before the stored state colour, the tint row and the colour tag. ## Verified - Rendered on the integrated GPU, eight characters: white T-shirt with khaki shorts, a pink T-shirt, a white track jacket over navy trousers, lighter denim shorts, a pale blue shirt, brown sandals. The colours agree with the items' colour tags where they have one (pink, navy, blue, black, grey, white). - The same eight are pixel-identical between my first version (own loader) and this one through `matlib`. - `cargo test --workspace`: 148 core and 12 viewer tests pass. ## Not verified / known limits - `player_story000_00`'s top and shoes change (black top, dark shoes; a tint row gave red shoes before). Those items have both a preset and a tint row, and what the tint rows do on preset items is not known; which is right was not established. - The per-vertex sub-material id is not read: a garment with several sub-materials and no `materialid` texture is one colour. - Not applied: colour entry 1 (the colour the game fades towards), the three-stop gradient over the tiling fabric texture (`matlib::stops`; the fabric texture is not located), entries 2 and 3. - `outfit --look` exports are unchanged (the colouring is in the viewer). - macOS Metal renderer not run. ## Files `crates/sixng-core/src/pedlook.rs`, `matlib.rs` (one added function), `crates/sixng-gui/src/model_view.rs` (character colouring), `README.md`.
An outfit part now carries the base colours of its item's garment preset
(matlib, one per sub-material), and the viewer colours each texel of a
garment with the colour of its sub-material, read from the materialid
texture (sub-material 0 where a garment has none), shaded as before.
Preset colours come before the stored state colour, the tint row and the
colour tag. matlib::Index::load_or_build builds the preset index when it
is missing, so the viewer does not depend on a sixng materials run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:10:27 +00:00
github manually merged commit 31fc48f2aa into gh-pr/109/base 2026-11-26 20:10:30 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.