[PR #993] [MERGED] Far terrain: no faces for caves nothing can see into (-36% far quads) #2970

Closed
opened 2026-11-02 16:00:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/993
Author: @ludovic111
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @ludovic111

Base: main ← Head: perf/lod-buried-gaps


📝 Commits (2)

  • bf8d849 Far terrain: no dark band at the full-detail edge, no black cliffs
  • 895dc26 Far terrain: no faces for caves nothing can see into

📊 Changes

6 files changed (+335 additions, -54 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/gfx.rs (+21 -1)
📝 crates/horizon-client/src/gfx/lod.rs (+17 -0)
📝 crates/horizon-client/src/gfx/resident.rs (+30 -10)
📝 crates/horizon-client/src/lod.rs (+19 -1)
📝 crates/horizon-client/src/lod/mesh.rs (+245 -42)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Follow-up to @Online5277's terrain LODs (#771): far tiles with fewer vertices, so vertex memory and GPU time drop at every LOD distance. Stacked on #992 (review only the last commit).

What

Far tiles meshed every gap in their columns: caves and aquifers in visited and refined chunks, and the gaps kelp and seagrass leave in water. Most of these gaps are closed on every side, so their floors, ceilings and walls cost vertices and never show.

Before meshing, a tile now fills each gap below a column's top that no neighbouring column's open air looks into (every neighbour's top is at or above the gap's top). It uses the material below the gap, or the fluid above it (kelp in water). Cave mouths stay open, and so do unknown neighbours and cells meeting full-detail or finer terrain. Seed 1234, RD 12, LOD 64, overview: far-terrain quads go from 4.93 M to 3.17 M (−36%).

Numbers

Same seed, position and settings; builds run in turn a, b, a, b. "Vertex" is the renderer's terrain vertex memory once every target tile is sampled, and again after the three benches ("end").

Mac mini M4 Pro (Metal), RD 12:

LOD build vertex MB end MB GPU ms overview / meadow / peak
64 #992 557, 556 637, 639 0.52 / 0.45 / 0.41, 0.43 / 0.51 / 0.16
64 this 421, 421 481, 481 0.29 / 0.30 / 0.33, 0.29 / 0.34 / 0.42
256 #992 909 1017 0.35 / 0.60 / 0.60
256 this 753 840 0.34 / 0.46 / 0.47
1024 #992 1360 1480 0.52 / 0.20 / 0.16
1024 this 1197 1286 0.35 / 0.35 / 0.11

Mac FPS is too noisy to rank: other sessions share the machine and the GPU is idle at these loads.

ThinkPad, Intel HD 620 (Mesa ANV, Xvfb, nice 19), RD 12, LOD 64:

build covered in vertex MB FPS overview / meadow / peak 1% low GPU ms
#992 1404 s 564 74.6 / 81.5 / 79.3 61.7 / 66.3 / 17.1 13.3 / 12.2 / 12.1
this 711 s 422 102.7 / 119.6 / 103.5 76.4 / 109.8 / 23.7 9.6 / 8.3 / 9.1

All benches start once every target tile is sampled, so the table compares like with like. The ThinkPad is too slow for alternating rounds, so there is one full run per build. An earlier #992 run cut off at 900 s gave the same picture: 552 MB, 70.8 / 79.1 / 79.9 FPS, 13.8 / 12.5 / 12.0 ms GPU. The mesher has fewer faces to emit on a 4-thread CPU, which probably explains why coverage halves.

Screenshots

In ~/code/horizon-parity/shots/perf-frame-9/ (private repo): fin-overview-a1-b1-d1.png and fin-peak-a1-b1-d1.png (#992 | this | whole stack) look the same. cmp-fill-water.png checks the kelp gaps: the seafloor stays where it was (an earlier version raised it).

Self-check

cargo fmt --all --check                                    ok
cargo clippy --workspace --all-targets -- -D warnings      ok
cargo test -p horizon-client --lib                         924 passed, 13 ignored
tools/parity.py --changed origin/main                      98 passed, 0 failed (run on the whole stack)

New test: caves_no_neighbor_sees_into_add_no_faces.

Kira: card#23.

🤖 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/993 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/lod-buried-gaps` --- ### 📝 Commits (2) - [`bf8d849`](https://github.com/horizon-rust/horizon/commit/bf8d84930fe5675d4bb667220d48a1d347c13715) Far terrain: no dark band at the full-detail edge, no black cliffs - [`895dc26`](https://github.com/horizon-rust/horizon/commit/895dc26848cef7ca0e10badc2a3030ea7252748d) Far terrain: no faces for caves nothing can see into ### 📊 Changes **6 files changed** (+335 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/gfx.rs` (+21 -1) 📝 `crates/horizon-client/src/gfx/lod.rs` (+17 -0) 📝 `crates/horizon-client/src/gfx/resident.rs` (+30 -10) 📝 `crates/horizon-client/src/lod.rs` (+19 -1) 📝 `crates/horizon-client/src/lod/mesh.rs` (+245 -42) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Follow-up to @Online5277's terrain LODs (#771): far tiles with fewer vertices, so vertex memory and GPU time drop at every LOD distance. Stacked on #992 (review only the last commit). ## What Far tiles meshed every gap in their columns: caves and aquifers in visited and refined chunks, and the gaps kelp and seagrass leave in water. Most of these gaps are closed on every side, so their floors, ceilings and walls cost vertices and never show. Before meshing, a tile now fills each gap below a column's top that no neighbouring column's open air looks into (every neighbour's top is at or above the gap's top). It uses the material below the gap, or the fluid above it (kelp in water). Cave mouths stay open, and so do unknown neighbours and cells meeting full-detail or finer terrain. Seed 1234, RD 12, LOD 64, overview: far-terrain quads go from **4.93 M to 3.17 M** (−36%). ## Numbers Same seed, position and settings; builds run in turn a, b, a, b. "Vertex" is the renderer's terrain vertex memory once every target tile is sampled, and again after the three benches ("end"). **Mac mini M4 Pro (Metal)**, RD 12: | LOD | build | vertex MB | end MB | GPU ms overview / meadow / peak | | --- | --- | --- | --- | --- | | 64 | #992 | 557, 556 | 637, 639 | 0.52 / 0.45 / 0.41, 0.43 / 0.51 / 0.16 | | 64 | this | **421, 421** | **481, 481** | 0.29 / 0.30 / 0.33, 0.29 / 0.34 / 0.42 | | 256 | #992 | 909 | 1017 | 0.35 / 0.60 / 0.60 | | 256 | this | **753** | **840** | 0.34 / 0.46 / 0.47 | | 1024 | #992 | 1360 | 1480 | 0.52 / 0.20 / 0.16 | | 1024 | this | **1197** | **1286** | 0.35 / 0.35 / 0.11 | Mac FPS is too noisy to rank: other sessions share the machine and the GPU is idle at these loads. **ThinkPad, Intel HD 620 (Mesa ANV, Xvfb, nice 19)**, RD 12, LOD 64: | build | covered in | vertex MB | FPS overview / meadow / peak | 1% low | GPU ms | | --- | --- | --- | --- | --- | --- | | #992 | 1404 s | 564 | 74.6 / 81.5 / 79.3 | 61.7 / 66.3 / 17.1 | 13.3 / 12.2 / 12.1 | | this | **711 s** | **422** | **102.7 / 119.6 / 103.5** | 76.4 / 109.8 / 23.7 | **9.6 / 8.3 / 9.1** | All benches start once every target tile is sampled, so the table compares like with like. The ThinkPad is too slow for alternating rounds, so there is one full run per build. An earlier #992 run cut off at 900 s gave the same picture: 552 MB, 70.8 / 79.1 / 79.9 FPS, 13.8 / 12.5 / 12.0 ms GPU. The mesher has fewer faces to emit on a 4-thread CPU, which probably explains why coverage halves. ## Screenshots In `~/code/horizon-parity/shots/perf-frame-9/` (private repo): `fin-overview-a1-b1-d1.png` and `fin-peak-a1-b1-d1.png` (#992 | this | whole stack) look the same. `cmp-fill-water.png` checks the kelp gaps: the seafloor stays where it was (an earlier version raised it). ## Self-check ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok cargo test -p horizon-client --lib 924 passed, 13 ignored tools/parity.py --changed origin/main 98 passed, 0 failed (run on the whole stack) ``` New test: `caves_no_neighbor_sees_into_add_no_faces`. Kira: card#23. 🤖 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-02 16:00:30 +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#2970
No description provided.