Skip to content

Haze on tree, bush and facade impostors - #16

Merged
mbeczynski merged 1 commit into
mainfrom
feat/haze-impostors
Oct 21, 2026
Merged

mbeczynski merged 1 commit into
mainfrom
feat/haze-impostors

Conversation

@mbeczynski

Copy link
Copy Markdown
Contributor

Impostors (trees, bushes, building facades) used a plain unlit material, so they kept full contrast while the ground, walls and buildings around them faded into the haze.

  • New unlit surface shader impostorSurface (Ground.metal) mixes the photo with the haze colour by distance, like the other scenery shaders.
  • Cut-out is a discard_fragment() below the mask threshold in an opaque material. A transparent CustomMaterial with opacityThreshold drew without depth: farther trees covered nearer bushes (caught on a fixed-frame comparison, forest side camera).
  • Tracks without haze (garage, -noHaze) keep the old UnlitMaterial.
  • The shader compiles with the other scenery shaders on the loading screen; no opacity threshold is set on the main thread any more.
  • README: haze is computed in the scenery shaders, not read from the depth buffer.

Testing (simulator, iPad M5, iOS 27)

  • Canary -haze 0.99,20: trees, bushes and facades fog together with walls and road (forest, city, snow).
  • -haze 0.001,20 vs -noHaze: same tree colour close up; foliage slightly denser (hard mask edge instead of blended).
  • tools/scenery-shots.sh, all five regions with normal haze: look correct, frame time unchanged (simulator capped at 60 fps).
  • GameplayUITests: 7/7 passed.

🤖 Generated with Claude Code

Impostors used a plain unlit material, so distant trees and facades kept
full contrast while everything around them faded into the haze.

They now use an unlit surface shader (impostorSurface) with the same haze
as the rest of the scenery. The cut-out is a discard below the mask
threshold in an opaque material: a transparent CustomMaterial with an
opacity threshold drew without depth, and farther trees covered nearer
bushes. Tracks without haze keep the old UnlitMaterial.

README: haze lives in the scenery shaders, not in post-processing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mbeczynski
mbeczynski merged commit 2e8789d into main Oct 21, 2026
1 check passed
@mbeczynski
mbeczynski deleted the feat/haze-impostors branch October 22, 2026 09:20
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