Hair: the style pass in the game's turning frame, on by default #313

Manually merged
github merged 3 commits from gh-pr/313/head into gh-pr/313/base 2026-11-26 20:26:35 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 21:26 UTC · original
holdmysocks:claude/people-style-frame → master · +70 −26 · 3 files · 3 commits · merged 2026-11-25 22:02 UTC

The strand style pass now uses the frame the game's strand generator writes, so it can be on by default.

What the generator does. It writes the style axis into every generated point, and the style pass reads it back:

  • Start from a direction in the root triangle's plane. The game picks it from its clump offset table by a strand hash; the viewer uses an angle from the strand's own draw.
  • Make it square to the strand, then turn it about the strand by θ(u). θ is interpolated at 3u between four knot angles.
  • Each knot is the barycentric blend of the three root guides' bytes, byte × 2π/255 − π, from a per-guide table at graphics header +0x24 (4 bytes per guide).
  • On Mandy's long layer the table holds exactly 201 entries, one per guide, and ends where the style records begin.

Before this, the viewer used the root normal with no turn. That threw strands across the face, so #311 had kept the pass off.

Changes

  • Groom::twist holds the +0x24 table.
  • Style::apply takes the axis per point.
  • coat_with builds the turning frame for scattered, mode-2 and mode-16 strands.
  • Style records all share the first record's sample count; a shorter trailing record is no longer read as one.
  • The pass is on for pieces that have the table, at the game's normal strength 1, damped near the body (#311). Pieces without the table stay off.
  • SIXNG_STYLE=<k> sets the strength (0 = off). SIXNG_STYLE_TWIST=-1 turns the frame the other way, for comparison. The turn direction is a medium-confidence reading; both directions look alike at viewing distance.

Result

  • Mandy at the two game-frame angles: the lengths get soft waves and fuller ends, and no strands cross the face.
  • Pieces without the table (brows and most short layers) are unchanged.

Tests: sixng-core 296, sixng-gui 45 and sixng-cli 1 pass.

**@⁠holdmysocks** on GitHub · 2026-11-25 21:26 UTC · [original](https://github.com/holdmysocks/SixNG/pull/313) `holdmysocks:claude/people-style-frame` → `master` · +70 −26 · 3 files · 3 commits · merged 2026-11-25 22:02 UTC The strand style pass now uses the frame the game's strand generator writes, so it can be on by default. **What the generator does.** It writes the style axis into every generated point, and the style pass reads it back: - Start from a direction in the root triangle's plane. The game picks it from its clump offset table by a strand hash; the viewer uses an angle from the strand's own draw. - Make it square to the strand, then turn it about the strand by θ(u). θ is interpolated at 3u between four knot angles. - Each knot is the barycentric blend of the three root guides' bytes, byte × 2π/255 − π, from a per-guide table at graphics header +0x24 (4 bytes per guide). - On Mandy's long layer the table holds exactly 201 entries, one per guide, and ends where the style records begin. Before this, the viewer used the root normal with no turn. That threw strands across the face, so #311 had kept the pass off. **Changes** - `Groom::twist` holds the +0x24 table. - `Style::apply` takes the axis per point. - `coat_with` builds the turning frame for scattered, mode-2 and mode-16 strands. - Style records all share the first record's sample count; a shorter trailing record is no longer read as one. - The pass is on for pieces that have the table, at the game's normal strength 1, damped near the body (#311). Pieces without the table stay off. - `SIXNG_STYLE=<k>` sets the strength (`0` = off). `SIXNG_STYLE_TWIST=-1` turns the frame the other way, for comparison. The turn direction is a medium-confidence reading; both directions look alike at viewing distance. **Result** - Mandy at the two game-frame angles: the lengths get soft waves and fuller ends, and no strands cross the face. - Pieces without the table (brows and most short layers) are unchanged. Tests: sixng-core 296, sixng-gui 45 and sixng-cli 1 pass.
The strand generator writes each point's style axis: a direction in the
root triangle's plane, made square to the strand and turned about it by
an angle interpolated at 3u between four knots. Each knot is the root
guides' barycentric blend of a byte (x 2 pi / 255 - pi) from a per-guide
table at graphics header +0x24. The viewer used the root normal with no
turn, which threw strands across the face.

With that frame the stored style shape lays soft waves through the
lengths, so the pass is on for pieces with the table, at the game's
normal strength 1 and damped near the body. SIXNG_STYLE=<k> sets the
strength (0 = off). Style records of a piece all have the first record's
sample count; a shorter trailing one is no record.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:26:34 +00:00
github manually merged commit 8e7437f47d into gh-pr/313/base 2026-11-26 20:26:35 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.