Skip to content

Reduce Gaussian blur to preserve mountain terrain detail - #896

Merged
louis-e merged 2 commits into
mainfrom
fix/terrain-blur-preserve-mountain-detail
Apr 6, 2026
Merged

louis-e merged 2 commits into
mainfrom
fix/terrain-blur-preserve-mountain-detail

Conversation

@louis-e

@louis-e louis-e commented Apr 6, 2026

Copy link
Copy Markdown
Owner

The terrain sigma floor (×12) was designed to suppress SRTM rooftop artifacts in dense urban areas (Manhattan), but it flattened mountains into gentle walkable slopes everywhere. Reduce to ×3 (still covers Voronoi-block suppression from NaN-fill) and halve BASE_SIGMA_REF from 5.0 to 2.5 so the grid-proportional component also preserves more detail.

Result: mountains now have 2-3 block steps on steep faces (realistic cliff terrain) while cities remain smooth (~0.4 max step). The slope-based material system (grass → gravel → stone) will activate more often on steep terrain, adding visual realism.

The terrain sigma floor (×12) was designed to suppress SRTM rooftop
artifacts in dense urban areas (Manhattan), but it flattened mountains
into gentle walkable slopes everywhere. Reduce to ×3 (still covers
Voronoi-block suppression from NaN-fill) and halve BASE_SIGMA_REF
from 5.0 to 2.5 so the grid-proportional component also preserves
more detail.

Result: mountains now have 2-3 block steps on steep faces (realistic
cliff terrain) while cities remain smooth (~0.4 max step). The
slope-based material system (grass → gravel → stone) will activate
more often on steep terrain, adding visual realism.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copilot AI review requested due to automatic review settings April 6, 2026 19:32
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 47s
🧠 Peak memory usage: 1705 MB

📈 Compared against baseline: 30s
🧮 Delta: 17s
🔢 Commit: 310cf89

🚨 This PR drastically worsens generation time.

📅 Last benchmark: 2026-04-06 19:34:55 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts elevation smoothing parameters in fetch_elevation_data to reduce over-blurring so mountainous terrain retains sharper features while still smoothing NaN-fill/Voronoi artifacts and minor SRTM noise.

Changes:

  • Reduce the terrain-floor blur multiplier from ×12 to ×3.
  • Halve the grid-reference blur constant (BASE_SIGMA_REF) from 5.0 to 2.5.
  • Update inline documentation and unit tests to reflect the new sigma behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/elevation_data.rs Outdated
Rename test_output_sigma_large_bbox_no_regression to
test_output_sigma_large_bbox_grid_dominates and update its comment
to accurately reflect what it tests: that sigma_from_grid wins for
large areas, without implying value parity with the old constants.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@louis-e
louis-e merged commit 6f54e2f into main Apr 6, 2026
2 checks passed
@louis-e
louis-e deleted the fix/terrain-blur-preserve-mountain-detail branch April 6, 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.

2 participants