Skin shading: the body kept out of its own mirrored surroundings (last jaw rim, #308) #364

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

@⁠holdmysocks on GitHub · 2026-11-26 06:36 UTC · original
holdmysocks:issue-308-reflect → master · +42 −1 · 1 files · 1 commits · merged 2026-11-26 06:43 UTC

Follow-up to #334 for #308. After #334 a faint pale rim stayed at the very edge of characters' jaws. This removes it.

What the rim was

  • A debug render of the specular ambient alone shows the rim. It is the sky and ground the viewer mirrors at grazing angles under the jaw.
  • In the game, the specular ambient comes from its traced reflections, which see the body itself. A ray leaving the skin under the jaw meets the neck.
  • From roughness 0.5 up, the game's bent-cone specular occlusion is off, so on skin nothing but that trace keeps the body out of the reflection. The viewer's surroundings are a plain sky and ground with nothing of the model in them.

Change (shader only)

  • On surfaces where the cone test is off (roughness 0.5 and up, hair excluded), the mirror ray is marched through the camera depth pre-pass.
  • Where it meets the model, the surface's own ambient light stands in for the sky and ground.
  • The march's first step and its hit thickness (2 to 8 cm) are random per pixel and frame, so the frame accumulation softens the edges of what it finds.

Renders (viewer on the RTX 4080; before = a master build from before #334, so the face detail #334 brought shows too; the rim was checked step by step on the #334 build, with and without this change)

  • Lucia: the rim under the jaw is gone, at the default body and at weight -1 and 1, muscle 1, and weight and muscle 1.
  • Raina: the same rim is gone.
  • Cal, Felipe, Big Mike: no rim or patches. The only other difference from #334 is the face detail. Big Mike's black shirt is a little darker in its folds.
  • Rancher: mean pixel difference 0.18 of 255, so it looks the same.

Tried and dropped

  • A march with fixed steps and thickness left a hard-edged streak on Lucia's collarbone, where rays reach the chin. With the random march it is a faint, soft warm tint, which is plausible: skin there would reflect the chin.
  • Fading hits by distance removed the streak but brought the rim back.

Checked

  • cargo test --release -p sixng-gui on current master: 49 passed, 2 ignored.

Not verified

  • A comparison with the game itself. The trace is screen-space, so what is hidden from the camera does not block anything.
**@⁠holdmysocks** on GitHub · 2026-11-26 06:36 UTC · [original](https://github.com/holdmysocks/SixNG/pull/364) `holdmysocks:issue-308-reflect` → `master` · +42 −1 · 1 files · 1 commits · merged 2026-11-26 06:43 UTC Follow-up to #334 for #308. After #334 a faint pale rim stayed at the very edge of characters' jaws. This removes it. **What the rim was** - A debug render of the specular ambient alone shows the rim. It is the sky and ground the viewer mirrors at grazing angles under the jaw. - In the game, the specular ambient comes from its traced reflections, which see the body itself. A ray leaving the skin under the jaw meets the neck. - From roughness 0.5 up, the game's bent-cone specular occlusion is off, so on skin nothing but that trace keeps the body out of the reflection. The viewer's surroundings are a plain sky and ground with nothing of the model in them. **Change** (shader only) - On surfaces where the cone test is off (roughness 0.5 and up, hair excluded), the mirror ray is marched through the camera depth pre-pass. - Where it meets the model, the surface's own ambient light stands in for the sky and ground. - The march's first step and its hit thickness (2 to 8 cm) are random per pixel and frame, so the frame accumulation softens the edges of what it finds. **Renders** (viewer on the RTX 4080; before = a master build from before #334, so the face detail #334 brought shows too; the rim was checked step by step on the #334 build, with and without this change) - Lucia: the rim under the jaw is gone, at the default body and at weight -1 and 1, muscle 1, and weight and muscle 1. - Raina: the same rim is gone. - Cal, Felipe, Big Mike: no rim or patches. The only other difference from #334 is the face detail. Big Mike's black shirt is a little darker in its folds. - Rancher: mean pixel difference 0.18 of 255, so it looks the same. **Tried and dropped** - A march with fixed steps and thickness left a hard-edged streak on Lucia's collarbone, where rays reach the chin. With the random march it is a faint, soft warm tint, which is plausible: skin there would reflect the chin. - Fading hits by distance removed the streak but brought the rim back. **Checked** - `cargo test --release -p sixng-gui` on current master: 49 passed, 2 ignored. **Not verified** - A comparison with the game itself. The trace is screen-space, so what is hidden from the camera does not block anything.
From roughness 0.5 up the game's bent-cone specular occlusion is off, and only its traced
reflections keep the body out of the specular ambient. The viewer now marches the mirror ray
through the camera depth pre-pass there; where it meets the model, the surface's own ambient
light stands in for the sky and ground. This removes the last pale rim under the jaw.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:30:40 +00:00
github manually merged commit 372dd441e7 into gh-pr/364/base 2026-11-26 20:30:41 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.