[PR #3468] [MERGED] LOD Distance: a slider up to the whole world, with heightmap far tiles #5002

Closed
opened 2026-11-03 05:09:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3468
Author: @AHHhHHHHH-H
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: pr/world-wide-lod-slider


📝 Commits (4)

  • 32f99ed LOD Distance: a slider up to the whole world, with heightmap far tiles
  • 976de52 Merge main; give the world-wide plan test real assertions
  • f88dcf6 Merge remote-tracking branch 'origin/main' into pr-3468
  • 0510ebd rustfmt

📊 Changes

8 files changed (+294 additions, -23 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+13 -0)
📝 crates/horizon-client-render/src/graphics.rs (+9 -4)
📝 crates/horizon-client-render/src/graphics_ui.rs (+52 -7)
📝 crates/horizon-client-render/src/lod.rs (+58 -4)
📝 crates/horizon-client-render/src/lod/mesh.rs (+153 -4)
📝 crates/horizon-client/src/game.rs (+1 -1)
📝 crates/horizon-client/src/game/control.rs (+7 -2)
📝 docs/graphics.md (+1 -1)

📄 Description

🤖 Opened by AHHhHHHHH-H's AI agent (Claude Code), not by AHHhHHHHH-H themselves.

What and why

Horizon's far terrain stops at 1024 chunks. FarPlaneTwo's heightmap mode can show the whole world. This makes LOD Distance reach it:

  • Settings: the LOD Distance button becomes a slider: Off, then each doubling from 64 chunks up to 4194304 (the whole world: a level-22 tile is 67 M blocks). Values from the config file that sit between stops land on the next one. horizon-graphics.txt and lod-distance over the control socket accept the same range (they were capped at 1024).
  • Plan: up to 22 tile levels instead of 10. Tiles farther than 1024 chunks split at a wider ratio (WORLD_SPLIT), so the plan stays a few thousand tiles.
  • Heightmap tiles: from level 6 up a column is its top solid span down to the world floor plus the fluid over it, so strata that cannot be told apart from afar are not meshed.
  • Two cost blow-ups at coarse levels, fixed: a face that would be more than 4 pieces of 1024 blocks is one quad with scaled UVs (levels 11-13 took 3.5k, 11k and 33k quads per tile before); and the clip subdivision of a coarse tile around full-detail chunks is capped at 32 steps per cell (a level-22 stand-in tile kept the "Far terrain" thread at 100% CPU for minutes).
  • status over the control socket reports the tile counts per level (lod.levels).

Measured on a GTX 750 (2 GiB), 1280x720, render distance 8, Reduced far detail, same session:

LOD Distance tiles quads frames
1024 1790 2.8 M ~70-84 FPS
4194304 (whole world) 3589 5.5 M ~17-23 FPS, VRAM full

The whole world is about twice the quads of 1024 chunks, so on weak GPUs the slider should stay lower. From 20 million blocks up (the plan then needs far fewer tiles) a user-reported run reached ~96 FPS at 1920x1018.

Limits, left for later: tiles still use the 96-byte-per-quad terrain vertex, a real shared-index heightmap pipeline would make the far levels close to free; far tiles are not saved between sessions; elevation above 16384 blocks is still clamped when planning.

Possible overlap with #3390 ("Far tiles: with Reduced far detail, approximate wide cells"), which also changes how wide cells are meshed (lod/mesh.rs, lod.rs); I can rebase on whichever lands first.

Vanilla reference

Horizon-only (vanilla has no LOD terrain).

Self-check

pr_ready (tools/pr_ready.py --quick on a local machine, against origin/main at c6af85743, 5 min 20 s)

Check Result
Scope ✅ 8 files, +288 −23
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (44 s)
rustfmt ✅ (10 s)
clippy ❌ failed (1 min 13 s)
tests: horizon-client ❌ failed (2 min 14 s)
doc tests ✅ 0 passed (1 min 0 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

On this machine (GTX 750, Rust 1.97.1) the block above shows two failures that are not caused by this change:

  • clippy stops in horizon-world (manual_range_contains, worldgen/aquifer/noise_based.rs:450), a file this PR does not touch, so horizon-client is never linted by that run. cargo clippy -p horizon-client --all-targets -- -D warnings -A clippy::manual_range_contains is clean.
  • horizon-client tests die with SIGSEGV in a different GPU test each run on the NVIDIA driver. With the software Vulkan driver (VK_DRIVER_FILES=.../lvp_icd.x86_64.json) cargo test -p horizon-client passes: 1122 lib tests + the integration tests, 0 failed.

CI is the authority; I have not run the vanilla parity harnesses (--quick).

Screenshots

Not attached (taken on my side as local files): the whole-world view from 4000 blocks up shows the biome map out to the horizon; from the ground, terrain and biomes continue to the horizon.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3468 **Author:** [@AHHhHHHHH-H](https://github.com/AHHhHHHHH-H) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `pr/world-wide-lod-slider` --- ### 📝 Commits (4) - [`32f99ed`](https://github.com/horizon-rust/horizon/commit/32f99ed5f7a9a29248ecd39c05470b9babcea362) LOD Distance: a slider up to the whole world, with heightmap far tiles - [`976de52`](https://github.com/horizon-rust/horizon/commit/976de52032a40d9877e7b983e2375c36eb93b0c6) Merge main; give the world-wide plan test real assertions - [`f88dcf6`](https://github.com/horizon-rust/horizon/commit/f88dcf6379a25ea1a0fb1b6df89eae3bd0b110d3) Merge remote-tracking branch 'origin/main' into pr-3468 - [`0510ebd`](https://github.com/horizon-rust/horizon/commit/0510ebdfbf7b4760cc758d5f29da63b40f1996c7) rustfmt ### 📊 Changes **8 files changed** (+294 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+13 -0) 📝 `crates/horizon-client-render/src/graphics.rs` (+9 -4) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+52 -7) 📝 `crates/horizon-client-render/src/lod.rs` (+58 -4) 📝 `crates/horizon-client-render/src/lod/mesh.rs` (+153 -4) 📝 `crates/horizon-client/src/game.rs` (+1 -1) 📝 `crates/horizon-client/src/game/control.rs` (+7 -2) 📝 `docs/graphics.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by AHHhHHHHH-H's AI agent (Claude Code), not by AHHhHHHHH-H themselves. ## What and why Horizon's far terrain stops at 1024 chunks. FarPlaneTwo's heightmap mode can show the whole world. This makes LOD Distance reach it: - **Settings:** the LOD Distance button becomes a slider: Off, then each doubling from 64 chunks up to 4194304 (the whole world: a level-22 tile is 67 M blocks). Values from the config file that sit between stops land on the next one. `horizon-graphics.txt` and `lod-distance` over the control socket accept the same range (they were capped at 1024). - **Plan:** up to 22 tile levels instead of 10. Tiles farther than 1024 chunks split at a wider ratio (`WORLD_SPLIT`), so the plan stays a few thousand tiles. - **Heightmap tiles:** from level 6 up a column is its top solid span down to the world floor plus the fluid over it, so strata that cannot be told apart from afar are not meshed. - **Two cost blow-ups at coarse levels, fixed:** a face that would be more than 4 pieces of 1024 blocks is one quad with scaled UVs (levels 11-13 took 3.5k, 11k and 33k quads per tile before); and the clip subdivision of a coarse tile around full-detail chunks is capped at 32 steps per cell (a level-22 stand-in tile kept the "Far terrain" thread at 100% CPU for minutes). - `status` over the control socket reports the tile counts per level (`lod.levels`). Measured on a GTX 750 (2 GiB), 1280x720, render distance 8, Reduced far detail, same session: | LOD Distance | tiles | quads | frames | |---|---|---|---| | 1024 | 1790 | 2.8 M | ~70-84 FPS | | 4194304 (whole world) | 3589 | 5.5 M | ~17-23 FPS, VRAM full | The whole world is about twice the quads of 1024 chunks, so on weak GPUs the slider should stay lower. From 20 million blocks up (the plan then needs far fewer tiles) a user-reported run reached ~96 FPS at 1920x1018. Limits, left for later: tiles still use the 96-byte-per-quad terrain vertex, a real shared-index heightmap pipeline would make the far levels close to free; far tiles are not saved between sessions; elevation above 16384 blocks is still clamped when planning. Possible overlap with #3390 ("Far tiles: with Reduced far detail, approximate wide cells"), which also changes how wide cells are meshed (`lod/mesh.rs`, `lod.rs`); I can rebase on whichever lands first. ## Vanilla reference Horizon-only (vanilla has no LOD terrain). ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on a local machine, against origin/main at c6af85743, 5 min 20 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +288 −23 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (44 s) | | rustfmt | ✅ (10 s) | | clippy | ❌ failed (1 min 13 s) | | tests: horizon-client | ❌ failed (2 min 14 s) | | doc tests | ✅ 0 passed (1 min 0 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | On this machine (GTX 750, Rust 1.97.1) the block above shows two failures that are not caused by this change: - clippy stops in `horizon-world` (`manual_range_contains`, `worldgen/aquifer/noise_based.rs:450`), a file this PR does not touch, so `horizon-client` is never linted by that run. `cargo clippy -p horizon-client --all-targets -- -D warnings -A clippy::manual_range_contains` is clean. - `horizon-client` tests die with SIGSEGV in a different GPU test each run on the NVIDIA driver. With the software Vulkan driver (`VK_DRIVER_FILES=.../lvp_icd.x86_64.json`) `cargo test -p horizon-client` passes: 1122 lib tests + the integration tests, 0 failed. CI is the authority; I have not run the vanilla parity harnesses (`--quick`). ## Screenshots Not attached (taken on my side as local files): the whole-world view from 4000 blocks up shows the biome map out to the horizon; from the ground, terrain and biomes continue to the horizon. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5002
No description provided.