Hair: settle the guides as the game's strand simulation does #444

Manually merged
github merged 2 commits from github-bot/gh-444 into gh-pr/444/base 2026-11-27 03:47:33 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-27 03:02 UTC · original
holdmysocks:people/hair-settle → master · +281 −5 · 3 files · 2 commits · merged 2026-11-27 03:44 UTC

What the game does

Every frame the game runs a strand simulation on each groom's guides. Close to the camera it uses the full pass. On a still character the result is hair hanging under gravity and draping over the shoulders, not the stored shape.

The per-point inputs are stored with the groom:

  • pull and bend compliance (graphics header +0x34)
  • rest lengths (+0x38)
  • a bend-constraint flag (+0x50 bit 7)
  • a damping rate (system +0xF6)

What changed

  • groom::parse reads those inputs into SimData. It is None when a groom stores none; that groom is drawn as stored.
  • Groom::settle runs the pass to rest:
    • gravity, and the pull back to the stored shape with f = 1 / (1 + a·c / dt²)
    • follow-the-leader rest lengths with the game's look-ahead
    • the bend constraint toward the stored segment angles, stiffened near colliders
    • push-out of the body colliders
  • Colliders::push_out moves a point back onto the collider surface.
  • The viewer settles each groom before drawing. SIXNG_HAIR_NO_SIM=1 keeps the stored guides.

Left out

  • The leash on the pull. It needs the per-node pose data (stretch ratio and B3 offsets), now decoded; next PR.
  • The point radius and extra damping, which are set at run time.
  • Wind.

Checks

  • Unit tests: a soft guide hangs and keeps its lengths; a stiff guide keeps its shape; the bend constraint keeps a stored corner; a groom without data is left alone; push-out lands on the surface. All crate tests pass.
  • Mandy, front, side and at the game-frame angles: the hair now hangs in front of the shoulders with its waves kept, closer to the game frames.
  • Lucia: ponytail and front look the same as before.
**@⁠holdmysocks** on GitHub · 2026-11-27 03:02 UTC · [original](https://github.com/holdmysocks/SixNG/pull/444) `holdmysocks:people/hair-settle` → `master` · +281 −5 · 3 files · 2 commits · merged 2026-11-27 03:44 UTC ## What the game does Every frame the game runs a strand simulation on each groom's guides. Close to the camera it uses the full pass. On a still character the result is hair hanging under gravity and draping over the shoulders, not the stored shape. The per-point inputs are stored with the groom: - pull and bend compliance (graphics header +0x34) - rest lengths (+0x38) - a bend-constraint flag (+0x50 bit 7) - a damping rate (system +0xF6) ## What changed - `groom::parse` reads those inputs into `SimData`. It is None when a groom stores none; that groom is drawn as stored. - `Groom::settle` runs the pass to rest: - gravity, and the pull back to the stored shape with f = 1 / (1 + a·c / dt²) - follow-the-leader rest lengths with the game's look-ahead - the bend constraint toward the stored segment angles, stiffened near colliders - push-out of the body colliders - `Colliders::push_out` moves a point back onto the collider surface. - The viewer settles each groom before drawing. `SIXNG_HAIR_NO_SIM=1` keeps the stored guides. ## Left out - The leash on the pull. It needs the per-node pose data (stretch ratio and B3 offsets), now decoded; next PR. - The point radius and extra damping, which are set at run time. - Wind. ## Checks - Unit tests: a soft guide hangs and keeps its lengths; a stiff guide keeps its shape; the bend constraint keeps a stored corner; a groom without data is left alone; push-out lands on the surface. All crate tests pass. - Mandy, front, side and at the game-frame angles: the hair now hangs in front of the shoulders with its waves kept, closer to the game frames. - Lucia: ponytail and front look the same as before.
The viewer drew the guides as stored. The game runs its strand simulation
on them every frame, so on a still character the hair hangs under gravity
and drapes over the shoulders. Port the close-up simulation pass:

- read the groom's simulation inputs: per-point pull and bend compliance
  (graphics header B1), rest lengths (B2), the bend-constraint flag
  (header +0x50 bit 7) and the damping rate (system +0xF6)
- Groom::settle: gravity, the pull back to the stored shape with
  f = 1 / (1 + a c / dt^2), follow-the-leader rest lengths with the
  game's look-ahead, the bend constraint toward the stored segment
  angles (stiffened near colliders), and push-out of the body colliders,
  run to rest
- the viewer settles each groom before drawing; SIXNG_HAIR_NO_SIM=1
  keeps the stored guides for research

Left out: the leash scale on the pull (needs per-node pose data), the
point radius and extra damping set at run time, and wind.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:02:54 +00:00
github-bot changed target branch from master to gh-pr/444/base 2026-11-27 03:47:32 +00:00
github manually merged commit a8a0aa291f into gh-pr/444/base 2026-11-27 03:47:33 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.