Skip to content

Scenery 1/3: realistic asphalt, ground matched to panoramas, working haze - #12

Merged
mbeczynski merged 1 commit into
mainfrom
feat/scenery-1-ground
Oct 20, 2026
Merged

mbeczynski merged 1 commit into
mainfrom
feat/scenery-1-ground

Conversation

@mbeczynski

Copy link
Copy Markdown
Contributor

Replaces #7 (closed when its base branch was deleted after merging #6). Same branch, same content.

Changes

  • Asphalt — the photo had ~1% albedo (mean 34/255 sRGB), so the road rendered almost black and took ~40% of every frame. Rebrightened in linear space to a realistic ~8–10% and desaturated. New roadSurface shader adds what a 4 m tile cannot have: large-scale patches, polished wheel tracks in every lane, an oil strip, and dust near the kerbs. Road paint and start line were rebaked from the new asphalt (wear thresholds normalised to the old brightness).
  • Ground — the texture colour is pulled toward the ground band just below the panorama horizon (e.g. grey sand in front of a white beach), so the 3D ground fades into the photo with no colour seam. City ground is now a pavement (ambientCG PavingStones128, CC0, added to credits) instead of dry grass.
  • Haze (bug fix) — the post-process fog never worked: RealityKit passes the post effect an empty depth texture (z = 0 in every pixel; verified with an extreme-fog canary and a depth visualisation, also with MSAA off). Fog now lives in the scenery shaders — ground, road, and every opaque PBR material via the new hazeSurface — with per-region density and range. Post-process fog is disabled so it cannot double up if a device ever provides depth. -haze d,s / -noHaze for tuning (Debug/Family). Photo impostors (trees, unlit) are not hazed yet.
  • tools/prep-textures.swift — AO multiply, linear gain with desaturation.

Tests

  • swift test: 55 tests, 0 failures; Debug / Family / Release builds succeeded
  • Canary: -haze 0.99,20 fogs buildings, walls and road completely (hazy materials in 47–51 models per track)
  • Fixed frames (-shotAt 150), 5 regions × race/side camera, before/after compared; garage floor unchanged
  • Live 45 s races (city, forest): p95 frame 16.8–16.9 ms (same as before), no crash reports

🤖 Generated with Claude Code

https://claude.ai/code/session_018YYRkMvxEa4GxWLW2SrVyF

- Asphalt: the photo had ~1% albedo (mean 34/255, near black); rebrightened in
  linear space to a real ~8-10% and desaturated. New `roadSurface` shader adds
  large-scale patches, polished wheel tracks per lane, oil strip and dust at the
  kerbs. Road paint / start line rebaked from the new asphalt (wear thresholds
  normalized to the old brightness).
- Ground: colour pulled toward the ground band just below the panorama horizon,
  so the 3D ground fades into the photo without a colour seam. City ground is
  a pavement (ambientCG PavingStones128, CC0) instead of dry grass.
- Haze: post-process fog never worked — RealityKit hands the post effect an
  empty depth texture (z = 0 everywhere, checked with an extreme-fog canary and
  a depth view, also without MSAA). Fog now lives in the scenery shaders
  (ground, road, and every opaque PBR material via `hazeSurface`), per-region
  density/range; post-process fog is off so it cannot double up on a device.
  `-haze d,s` / `-noHaze` for tuning (Debug/Family).
- tools/prep-textures.swift: AO multiply, linear gain with desaturation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018YYRkMvxEa4GxWLW2SrVyF
@mbeczynski
mbeczynski merged commit 0970294 into main Oct 20, 2026
2 checks passed
@mbeczynski
mbeczynski deleted the feat/scenery-1-ground branch October 20, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant