Hair: strand tables from the game files, still-camera accumulation, viewer sun shadows #330

Manually merged
github merged 4 commits from gh-pr/330/head into gh-pr/330/base 2026-11-26 20:27:57 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-26 01:26 UTC · original
holdmysocks:claude/people-hair-tables → master · +595 −28 · 6 files · 4 commits · merged 2026-11-26 01:47 UTC

Two fixes so a plain viewer launch shows a character's hair like the comparison renders did, with no environment variables or external JSON.

Hair tables from the game files

  • New hairtables module in sixng-core: a reader for the RBF0 binary XML format, and a loader for the five hair strand databases (colour ramps and sets, parameter ramps and sets, LOD presets).
  • The loader scans the archive's small non-resource files for those root names. It caches the result in the workspace index, so the scan runs once.
  • The model viewer now uses these tables by default. The earlier JSON overrides still win when set.
  • Each hair slot (hair, brows, lashes) gets a default parameter set. The asset property naming each slot's own set is not traced yet.
  • Checked: a plain launch loads 481 colour sets, 202 parameter sets and 39 LOD presets. These match the earlier hand-made JSON exactly.

Still-camera accumulation (speckle fix)

  • While the view is unchanged, each frame takes the next strand dither pattern and is blended into a running mean. The mean covers 32 frames, then continues as a moving average.
  • Any change to the camera, light, models, joints, instances or materials restarts the mean.
  • Screenshots taken without SIXNG_SHOT_FRAMES wait for the mean to settle.
  • SIXNG_ACCUM=0 turns accumulation off.

Tests: sixng-core, sixng-gui and sixng-cli all pass. One unit test is new, for the RBF reader and the table builder.

Sun shadows on by default in the model viewer

  • The model viewer now draws the sun shadow map by default, so hair and bodies shadow themselves as they do in the game.
  • SIXNG_SHADOWS=0 turns it off.
  • Thumbnails and the 3D map are unchanged: they keep the shadow map off unless SIXNG_SHADOWS is set.
**@⁠holdmysocks** on GitHub · 2026-11-26 01:26 UTC · [original](https://github.com/holdmysocks/SixNG/pull/330) `holdmysocks:claude/people-hair-tables` → `master` · +595 −28 · 6 files · 4 commits · merged 2026-11-26 01:47 UTC Two fixes so a plain viewer launch shows a character's hair like the comparison renders did, with no environment variables or external JSON. **Hair tables from the game files** - New `hairtables` module in sixng-core: a reader for the RBF0 binary XML format, and a loader for the five hair strand databases (colour ramps and sets, parameter ramps and sets, LOD presets). - The loader scans the archive's small non-resource files for those root names. It caches the result in the workspace index, so the scan runs once. - The model viewer now uses these tables by default. The earlier JSON overrides still win when set. - Each hair slot (hair, brows, lashes) gets a default parameter set. The asset property naming each slot's own set is not traced yet. - Checked: a plain launch loads 481 colour sets, 202 parameter sets and 39 LOD presets. These match the earlier hand-made JSON exactly. **Still-camera accumulation (speckle fix)** - While the view is unchanged, each frame takes the next strand dither pattern and is blended into a running mean. The mean covers 32 frames, then continues as a moving average. - Any change to the camera, light, models, joints, instances or materials restarts the mean. - Screenshots taken without `SIXNG_SHOT_FRAMES` wait for the mean to settle. - `SIXNG_ACCUM=0` turns accumulation off. Tests: sixng-core, sixng-gui and sixng-cli all pass. One unit test is new, for the RBF reader and the table builder. **Sun shadows on by default in the model viewer** - The model viewer now draws the sun shadow map by default, so hair and bodies shadow themselves as they do in the game. - `SIXNG_SHADOWS=0` turns it off. - Thumbnails and the 3D map are unchanged: they keep the shadow map off unless `SIXNG_SHADOWS` is set.
The colour ramps and sets, the parameter ramps and sets and the hair LOD
presets are binary XML files of the packs archive. They are found through
the archive's table of contents by their root element, parsed (RBF0) and
cached in the index folder, so the viewer and its exports use the game's
colour sets, fibre parameters and strand counts without research files.
The parameter set per slot defaults to the sets checked against the game
frames, until the asset property naming it is read per asset. The env
overrides stay for research.
While nothing in the view changes, each frame takes the next strand dither
pattern and is blended into a running mean (32 frames, then a moving
average), so a still view of hair settles into a smooth image instead of
per-pixel speckle. Any change to the camera, light, models, joints,
instances or materials restarts the mean. Plain screenshots wait for the
mean to settle. SIXNG_ACCUM=0 turns it off.
Characters' hair and bodies now shadow themselves in a plain launch, as
in the game. SIXNG_SHADOWS=0 turns it off; thumbnails and the 3D map keep
it off unless SIXNG_SHADOWS is set.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:27:55 +00:00
github manually merged commit 0fd5e4c1ca into gh-pr/330/base 2026-11-26 20:27:57 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.