[PR #5160] [MERGED] Shader packs: terrain colours without the game's face shading #6108

Closed
opened 2026-11-03 06:11:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: shaderpacks/no-face-shading


📝 Commits (1)

  • f62ae6e Shader packs: terrain colours without the game's face shading

📊 Changes

9 files changed (+99 additions, -9 deletions)

View changed files

📝 crates/horizon-client-render/src/mesher.rs (+9 -3)
📝 crates/horizon-client-render/src/mesher/fluid.rs (+15 -6)
📝 crates/horizon-client-render/src/mesher/reuse_tests.rs (+51 -0)
📝 crates/horizon-client-render/src/streaming.rs (+7 -0)
📝 crates/horizon-client/examples/chunk_load_bench.rs (+1 -0)
📝 crates/horizon-client/examples/probe/section_mesh_fixture.rs (+1 -0)
📝 crates/horizon-client/src/game/shader_packs.rs (+13 -0)
📝 crates/horizon-client/tests/streaming_meshes.rs (+1 -0)
📝 crates/horizon-client/tests/tall_column.rs (+1 -0)

📄 Description

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

What and why

Fixes #5158.

The section mesher bakes vanilla's face shading into terrain and fluid vertex colours (lighting::cardinal). With a shaders/ pack, Iris leaves it out unless the pack sets oldLighting=true: packs light faces themselves from the normal, so Horizon's terrain was shaded twice and its sides came out darker than in Iris.

  • Mesher::shader_pack_lighting (and Streaming::shader_pack_lighting, carried to the workers in MeshSettings): blocks and fluids get a directional factor of 1.0. Ambient occlusion and tints stay.
  • PackIds reads oldLighting from shaders.properties (off unless true). shader_pack_inputs sets the flag while a shaders/ pack runs and marks every section changed when it flips, so the world remeshes once on pack load and unload. Horizon's own packs and no pack keep vanilla's shading.
  • a_shader_pack_lights_the_faces_itself (ignored like its neighbour: it needs prepared resources) meshes a lone stone block: four colours without the flag, one with it.

Measured with a probe pack whose gbuffers_terrain writes gl_Color into the frame, superflat test world, same camera in both games. Terrain colour per face, Horizon over Iris (faces named by Iris's normal, samples where both view positions agree):

Face Horizon main This PR
up 1.000 1.000
north 0.804 1.001
east 0.597 1.000
west 0.600 1.000

Distant terrain tiles (lod/mesh.rs) still bake their own shade; with #4972 a pack's border fog hides most of them, so they are left for a follow-up.

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 (oldLighting). The reference is Iris 1.11.7 on Minecraft 26.3, run and observed with a probe pack (no source read). Without a pack nothing changes: lighting::cardinal as before.

Self-check

pr_ready (tools/pr_ready.py --quick on 6cd182588f2d, against origin/main at 38a97ea64, 6 min 59 s)

Check Result
Scope ✅ 9 files, +99 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 495 run, FAILED (errors=4) (2 min 21 s)
rustfmt ✅ (24 s)
clippy ✅ (2 min 3 s)
tests: horizon-client, horizon-client-render ✅ 2047 passed (2 min 7 s)
doc tests ✅ 0 passed (4 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. The ignored a_shader_pack_lights_the_faces_itself passes with prepared resources (HORIZON_MESH_TEST_RESOURCES=... cargo test -p horizon-client-render --lib a_shader_pack_lights_the_faces_itself -- --ignored).

🤖 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/5160 **Author:** [@TobiasLogic](https://github.com/TobiasLogic) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shaderpacks/no-face-shading` --- ### 📝 Commits (1) - [`f62ae6e`](https://github.com/horizon-rust/horizon/commit/f62ae6ea5372ce65e18a3bb8e1d40dc068218590) Shader packs: terrain colours without the game's face shading ### 📊 Changes **9 files changed** (+99 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/mesher.rs` (+9 -3) 📝 `crates/horizon-client-render/src/mesher/fluid.rs` (+15 -6) 📝 `crates/horizon-client-render/src/mesher/reuse_tests.rs` (+51 -0) 📝 `crates/horizon-client-render/src/streaming.rs` (+7 -0) 📝 `crates/horizon-client/examples/chunk_load_bench.rs` (+1 -0) 📝 `crates/horizon-client/examples/probe/section_mesh_fixture.rs` (+1 -0) 📝 `crates/horizon-client/src/game/shader_packs.rs` (+13 -0) 📝 `crates/horizon-client/tests/streaming_meshes.rs` (+1 -0) 📝 `crates/horizon-client/tests/tall_column.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by TobiasLogic's AI agent (Claude Code, Claude Opus 5.5), not by TobiasLogic personally. ## What and why Fixes #5158. The section mesher bakes vanilla's face shading into terrain and fluid vertex colours (`lighting::cardinal`). With a `shaders/` pack, Iris leaves it out unless the pack sets `oldLighting=true`: packs light faces themselves from the normal, so Horizon's terrain was shaded twice and its sides came out darker than in Iris. - `Mesher::shader_pack_lighting` (and `Streaming::shader_pack_lighting`, carried to the workers in `MeshSettings`): blocks and fluids get a directional factor of 1.0. Ambient occlusion and tints stay. - `PackIds` reads `oldLighting` from `shaders.properties` (off unless `true`). `shader_pack_inputs` sets the flag while a `shaders/` pack runs and marks every section changed when it flips, so the world remeshes once on pack load and unload. Horizon's own packs and no pack keep vanilla's shading. - `a_shader_pack_lights_the_faces_itself` (ignored like its neighbour: it needs prepared resources) meshes a lone stone block: four colours without the flag, one with it. Measured with a probe pack whose `gbuffers_terrain` writes `gl_Color` into the frame, superflat test world, same camera in both games. Terrain colour per face, Horizon over Iris (faces named by Iris's normal, samples where both view positions agree): | Face | Horizon main | This PR | | --- | --- | --- | | up | 1.000 | 1.000 | | north | 0.804 | 1.001 | | east | 0.597 | 1.000 | | west | 0.600 | 1.000 | Distant terrain tiles (`lod/mesh.rs`) still bake their own shade; with #4972 a pack's border fog hides most of them, so they are left for a follow-up. ## 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 (`oldLighting`). The reference is Iris 1.11.7 on Minecraft 26.3, run and observed with a probe pack (no source read). Without a pack nothing changes: `lighting::cardinal` as before. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 6cd182588f2d, against origin/main at 38a97ea64, 6 min 59 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +99 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 495 run, FAILED (errors=4) (2 min 21 s) | | rustfmt | ✅ (24 s) | | clippy | ✅ (2 min 3 s) | | tests: horizon-client, horizon-client-render | ✅ 2047 passed (2 min 7 s) | | doc tests | ✅ 0 passed (4 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. The ignored `a_shader_pack_lights_the_faces_itself` passes with prepared resources (`HORIZON_MESH_TEST_RESOURCES=... cargo test -p horizon-client-render --lib a_shader_pack_lights_the_faces_itself -- --ignored`). 🤖 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 06:11:52 +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#6108
No description provided.