Hair noise and curl: the game's frame (in-plane root axis, y = T x axis) #416

Manually merged
github merged 1 commit from github-bot/gh-416 into gh-pr/416/base 2026-11-27 02:10:03 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-26 21:58 UTC · original
holdmysocks:people/hair-curl-frizz → master · +52 −22 · 2 files · 1 commits · merged 2026-11-27 02:01 UTC

The hair's procedural noise and curl (#310) now use the game's frame. Before, they were built around the hair root's surface normal.

What the game does (decoder reading of the generation program, feature 128)

  • Per point, the frame comes from a vector A and the strand tangent T:
    • x = A made square to T;
    • y = T × A.
  • A is the guide's frame carried into the strand's root frame (B1, B2, with B2 × B1 the root normal). Where the strand runs along its guide, A works out to −B2, a fixed direction in the root's surface plane.
  • High confidence on the construction. B1 and B2 come from per-strand data that SixNG does not read.

What changed

  • hairgen::apply_style builds x = axis made square to T and y = T × axis. Before, x was the root normal made square to T, and y had the opposite sign.
    • So the curl now turns the same way as in the game.
    • The frame also no longer collapses where a strand runs along its root normal. Before, it skipped those points.
  • The callers pass an in-plane root direction square to the strand's heading:
    • normal × the strand's first segment in the root plane, for scattered strands;
    • the clump frame's second axis, for clumped and mode-16 strands.
    • Any in-plane direction only turns x and y about T. For curl that is a phase shift, and the phase is already random per strand.
    • The direction square to the heading keeps the frame clear of the tangent where hair lies along the scalp. A first try used the heading itself; on Lucia's nape that gave short strands sticking out sideways.
  • Docs updated: hairgen module, apply_style, Groom::coat and the export note.

Scope

  • 6,997 of 20,010 grooms have a curl and 7,148 have noise.

Checks

  • New unit test: the frame axes and handedness on a straight strand.
  • Tests: 330 core, 53 gui and cli pass. Clippy shows nothing new.
  • Renders of Lucia and Mandy (back, and a close-up of the back), before and after:
    • Mandy's waves keep their shape.
    • Lucia's nape strands now follow the head instead of crossing it.
    • Both characters only have curls of a few millimetres, so the change is fine detail.
  • Not part of this PR: renders on this base show a pale torso layer over Lucia's chest. It appears with #384 and has been reported separately.
**@⁠holdmysocks** on GitHub · 2026-11-26 21:58 UTC · [original](https://github.com/holdmysocks/SixNG/pull/416) `holdmysocks:people/hair-curl-frizz` → `master` · +52 −22 · 2 files · 1 commits · merged 2026-11-27 02:01 UTC The hair's procedural noise and curl (#310) now use the game's frame. Before, they were built around the hair root's surface normal. ## What the game does (decoder reading of the generation program, feature 128) - Per point, the frame comes from a vector A and the strand tangent T: - x = A made square to T; - y = T × A. - A is the guide's frame carried into the strand's root frame (B1, B2, with B2 × B1 the root normal). Where the strand runs along its guide, A works out to −B2, a fixed direction in the root's surface plane. - High confidence on the construction. B1 and B2 come from per-strand data that SixNG does not read. ## What changed - `hairgen::apply_style` builds x = axis made square to T and y = T × axis. Before, x was the root normal made square to T, and y had the opposite sign. - So the curl now turns the same way as in the game. - The frame also no longer collapses where a strand runs along its root normal. Before, it skipped those points. - The callers pass an in-plane root direction square to the strand's heading: - normal × the strand's first segment in the root plane, for scattered strands; - the clump frame's second axis, for clumped and mode-16 strands. - Any in-plane direction only turns x and y about T. For curl that is a phase shift, and the phase is already random per strand. - The direction square to the heading keeps the frame clear of the tangent where hair lies along the scalp. A first try used the heading itself; on Lucia's nape that gave short strands sticking out sideways. - Docs updated: hairgen module, `apply_style`, `Groom::coat` and the export note. ## Scope - 6,997 of 20,010 grooms have a curl and 7,148 have noise. ## Checks - New unit test: the frame axes and handedness on a straight strand. - Tests: 330 core, 53 gui and cli pass. Clippy shows nothing new. - Renders of Lucia and Mandy (back, and a close-up of the back), before and after: - Mandy's waves keep their shape. - Lucia's nape strands now follow the head instead of crossing it. - Both characters only have curls of a few millimetres, so the change is fine detail. - Not part of this PR: renders on this base show a pale torso layer over Lucia's chest. It appears with #384 and has been reported separately.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:39:33 +00:00
github-bot changed target branch from master to gh-pr/416/base 2026-11-27 02:10:01 +00:00
github manually merged commit dc8d630913 into gh-pr/416/base 2026-11-27 02:10:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.