[PR #4972] [MERGED] Shader packs: far is the chunk render distance, not the distant terrain's reach #5982

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4972
Author: @TobiasLogic
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: shaderpacks/far-render-distance


📝 Commits (1)

  • 48709c8 Shader packs: far is the chunk render distance, not the distant terrain's reach

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx/pack_uniforms.rs (+2 -1)

📄 Description

🤖 Opened by TobiasLogic's AI agent (Claude Code, Claude Opus 5.5), not by TobiasLogic personally.

What and why

Fixes #4970.

far read Frame::distance, the render-distance fog end. With Distant Terrain on, that is terrain_distance() * 16: the distant terrain's reach (LOD Distance 128: 2048 blocks). Iris gives packs the chunk render distance in blocks, and they fade terrain into the sky by it (Photon's border fog is exp2(-8 * pow8(d / far)), Complementary's border fog divides by far). So with far terrain on, the fog only began near the far terrain's edge and distant land stood out bright against the horizon.

far now reads Frame::detail_distance (streaming.radius * 16), the same as without far terrain. Horizon's own fog keeps using Frame::distance.

Read back with a probe pack (it writes uniforms into the frame as float bits), superflat world, render distance 8:

far
Iris 1.11.7 (no distant terrain) 128
Horizon main, LOD Distance 128 2048
This PR, LOD Distance 128 128

With a pack's fog at the render distance, terrain past it mostly fades into the sky, as it would in Iris, where nothing is drawn there. (fogStart and fogEnd still follow the distant terrain, 1984 and 2048 here; that is a separate difference.)

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Not vanilla: the shaders/ pack format. The reference is Iris 1.11.7 on Minecraft 26.3 (far there is the render distance in blocks, read back with a probe pack), run and observed only.

Self-check

pr_ready (tools/pr_ready.py --quick on 6cd182588f2d, against origin/main at 07042859e, 7 min 2 s)

Check Result
Scope ✅ 1 files, +2 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 486 run, FAILED (errors=4) (2 min 21 s)
rustfmt ✅ (23 s)
clippy ✅ (2 min 48 s)
tests: horizon-client-render ✅ 705 passed (1 min 28 s)
doc tests ✅ 0 passed (1 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)

Run on a rented Linux box with GPU tests on lavapipe. The 4 Python errors are that box's git 2.34 (git merge-tree --write-tree, in test_nightly_set and test_supervise); they pass with git 2.55.

Screenshots

Photon v1.4 doesn't run on main yet (one of its programs hits naga's "Expression not cached" panic), so these strips come from a build with other shader-pack fixes, before and after this change alone. Superflat world, render distance 8, looking at the horizon: with far at 2048 the grass runs bright to the horizon; with 128 it hazes out where Iris's world ends.

Photon at the horizon: Iris, before, after

🤖 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/4972 **Author:** [@TobiasLogic](https://github.com/TobiasLogic) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `shaderpacks/far-render-distance` --- ### 📝 Commits (1) - [`48709c8`](https://github.com/horizon-rust/horizon/commit/48709c8091802ea013090293529a2e2ce39f123f) Shader packs: far is the chunk render distance, not the distant terrain's reach ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx/pack_uniforms.rs` (+2 -1) </details> ### 📄 Description > 🤖 Opened by TobiasLogic's AI agent (Claude Code, Claude Opus 5.5), not by TobiasLogic personally. ## What and why Fixes #4970. `far` read `Frame::distance`, the render-distance fog end. With Distant Terrain on, that is `terrain_distance() * 16`: the distant terrain's reach (LOD Distance 128: 2048 blocks). Iris gives packs the chunk render distance in blocks, and they fade terrain into the sky by it (Photon's border fog is `exp2(-8 * pow8(d / far))`, Complementary's border fog divides by `far`). So with far terrain on, the fog only began near the far terrain's edge and distant land stood out bright against the horizon. `far` now reads `Frame::detail_distance` (`streaming.radius * 16`), the same as without far terrain. Horizon's own fog keeps using `Frame::distance`. Read back with a probe pack (it writes uniforms into the frame as float bits), superflat world, render distance 8: | | `far` | | --- | --- | | Iris 1.11.7 (no distant terrain) | 128 | | Horizon main, LOD Distance 128 | 2048 | | This PR, LOD Distance 128 | 128 | With a pack's fog at the render distance, terrain past it mostly fades into the sky, as it would in Iris, where nothing is drawn there. (`fogStart` and `fogEnd` still follow the distant terrain, 1984 and 2048 here; that is a separate difference.) ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Not vanilla: the `shaders/` pack format. The reference is Iris 1.11.7 on Minecraft 26.3 (`far` there is the render distance in blocks, read back with a probe pack), run and observed only. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 6cd182588f2d, against origin/main at 07042859e, 7 min 2 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +2 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 486 run, FAILED (errors=4) (2 min 21 s) | | rustfmt | ✅ (23 s) | | clippy | ✅ (2 min 48 s) | | tests: horizon-client-render | ✅ 705 passed (1 min 28 s) | | doc tests | ✅ 0 passed (1 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) | Run on a rented Linux box with GPU tests on lavapipe. The 4 Python errors are that box's git 2.34 (`git merge-tree --write-tree`, in `test_nightly_set` and `test_supervise`); they pass with git 2.55. ## Screenshots Photon v1.4 doesn't run on main yet (one of its programs hits naga's "Expression not cached" panic), so these strips come from a build with other shader-pack fixes, before and after this change alone. Superflat world, render distance 8, looking at the horizon: with `far` at 2048 the grass runs bright to the horizon; with 128 it hazes out where Iris's world ends. ![Photon at the horizon: Iris, before, after](https://raw.githubusercontent.com/TobiasLogic/horizon/pr-assets/pr2.png) 🤖 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:16:23 +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#5982
No description provided.