Viewer: ground bounce in the model view's ambient light #329

Manually merged
github merged 1 commit from gh-pr/329/head into gh-pr/329/base 2026-11-26 20:27:52 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-26 01:13 UTC · original
holdmysocks:claude/ground-bounce-ambient → master · +41 −7 · 3 files · 1 commits · merged 2026-11-26 01:24 UTC

Characters lit from behind by a low sun went dark brown on their shaded side in the model view: its ambient was the sky alone, with ground light only on surfaces facing straight down. In the game such shots keep the face and body lit by light bounced off the ground.

The model view's ambient now follows the map scene's ambient cube (cs_ambient):

  • the sky, as before;
  • a ground of the same albedo (0.15), lit by the sun and the sky, which fills (1 - n.y) / 2 of what a surface sees;
  • sun light bounced off lit surroundings, reaching a surface from every side: the timecycle's ambient_bounce_intensity times that albedo (0.5 when no weather is picked, the map's default too).

The bounce strength is read from the timecycle into daylight::Light::bounce, kept in Look::bounce and passed in sun_col.w. Hair still calls ambient with its strand tangent and gets the same light.

Test renders (character at a game-frame angle, 17 h, sun turned behind her):

  • back-lit: face and body about 45 % brighter (linear) on the shaded side, warm from the sunlit ground; no longer dark brown;
  • front-lit and midday: a little warm fill under the chin and arms (face +7 % in sRGB), nothing washed out;
  • hair: unchanged to the eye.

Not changed: the map view (it already had this term) and the Metal 4 renderer, which has its own shader.

Tests: cargo test -p sixng-core -p sixng-gui -p sixng-cli pass.

**@⁠holdmysocks** on GitHub · 2026-11-26 01:13 UTC · [original](https://github.com/holdmysocks/SixNG/pull/329) `holdmysocks:claude/ground-bounce-ambient` → `master` · +41 −7 · 3 files · 1 commits · merged 2026-11-26 01:24 UTC Characters lit from behind by a low sun went dark brown on their shaded side in the model view: its ambient was the sky alone, with ground light only on surfaces facing straight down. In the game such shots keep the face and body lit by light bounced off the ground. The model view's ambient now follows the map scene's ambient cube (cs_ambient): - the sky, as before; - a ground of the same albedo (0.15), lit by the sun and the sky, which fills (1 - n.y) / 2 of what a surface sees; - sun light bounced off lit surroundings, reaching a surface from every side: the timecycle's `ambient_bounce_intensity` times that albedo (0.5 when no weather is picked, the map's default too). The bounce strength is read from the timecycle into `daylight::Light::bounce`, kept in `Look::bounce` and passed in `sun_col.w`. Hair still calls `ambient` with its strand tangent and gets the same light. Test renders (character at a game-frame angle, 17 h, sun turned behind her): - back-lit: face and body about 45 % brighter (linear) on the shaded side, warm from the sunlit ground; no longer dark brown; - front-lit and midday: a little warm fill under the chin and arms (face +7 % in sRGB), nothing washed out; - hair: unchanged to the eye. Not changed: the map view (it already had this term) and the Metal 4 renderer, which has its own shader. Tests: `cargo test -p sixng-core -p sixng-gui -p sixng-cli` pass.
Characters lit from behind by a low sun went dark on their shaded side:
the model view's ambient was the sky alone, with ground light only on
surfaces facing straight down.

The ambient now follows the map scene's ambient cube: the sky, a ground
of the same albedo (0.15) lit by the sun and the sky that fills
(1 - n.y) / 2 of what a surface sees, and the sun light bounced off lit
surroundings from every side, the timecycle's ambient_bounce_intensity
(0.5 when no weather is picked) times that albedo. The bounce strength
comes from the timecycle through daylight::Light and rides in sun_col.w.

Back-lit test shot: face and body about 45 % brighter (linear) on the
shaded side; front-lit shots gain a little warm fill under the chin;
hair unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:27:49 +00:00
github manually merged commit 7ec6c7b94b into gh-pr/329/base 2026-11-26 20:27:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.