[PR #1158] [MERGED] Shader Packs page: the folder's path, Open Folder, a switch per pack #3104

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

📋 Pull Request Information

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

Base: main ← Head: fix/shader-pack-folder


📝 Commits (2)

  • 6ea7a51 Shader Packs page: the folder's path, Open Folder, a switch per pack
  • ac25d41 Shader Packs page: show the first line of a pack's error

📊 Changes

8 files changed (+465 additions, -41 deletions)

View changed files

📝 crates/horizon-client/src/game/options.rs (+5 -0)
📝 crates/horizon-client/src/game/shader_packs.rs (+7 -4)
📝 crates/horizon-client/src/game/startup_menu.rs (+5 -0)
📝 crates/horizon-client/src/graphics_ui.rs (+30 -17)
📝 crates/horizon-client/src/options_horizon.rs (+159 -8)
📝 crates/horizon-client/src/options_ui.rs (+216 -3)
📝 crates/horizon-client/src/shader_pack.rs (+31 -1)
📝 docs/shader-packs.md (+12 -8)

📄 Description

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

Fixes #941
Fixes #925

The Shader Pack setting was a cycle button. With an empty shaderpacks/ folder it cycled through a one-entry list and stayed on Off, with no word on where packs go. That is what brabus_ hit on Windows: his pack was in the version folder, but the game reads the game home's shaderpacks/.

This PR adds a Shader Packs page, the built-in manager asked for in #925, in both menu styles:

  • The folder. The full path of the game home's shaderpacks/:

    • %APPDATA%\horizon\shaderpacks on Windows;
    • ~/Library/Application Support/horizon/shaderpacks on macOS;
    • ~/.local/share/horizon/shaderpacks on Linux.

    The page also has an Open Folder button, which creates the folder if it is missing.

  • When the folder is empty, the page says so: "No shader packs: put a pack's folder or .zip in this folder".

  • One switch per pack, for Horizon packs and Iris/OptiFine packs alike. Picking a pack turns the others off; turning it off gives the vanilla look. The folder is reread at most once a second while the page is open, so a pack dropped in shows up without a restart.

  • A pack that fails keeps its row, marked Failed with the first line of the error. Classic menus show ON (Failed).

  • Getting there.

    • Horizon menus: a "Shader Packs" section in Options. The Graphics page's Shader Pack row opens it.
    • Classic menus: a "Shader Packs..." button on Video Settings. The Horizon Graphics row opens it.

Off stays the default, so nothing changes the vanilla look until a player picks a pack. docs/shader-packs.md now gives the folder per OS and describes the page.

Thanks to brabus_ / brabus for both reports (#941, #925) and to famescare for the default-pack idea.

#925: the default "performance" pack

#925 also asks for a Horizon default shader made for performance. This PR does not build one: a pack can't cost less than the vanilla frame. Every Horizon or Iris pack runs full-screen passes on top of the vanilla world pass, so it adds GPU work to every frame.

Measured here on the M4 Pro at 1280×720, same scene, renderer GPU timer p50:

Pack GPU p50
vanilla 0.01 ms
BSL 0.81 ms
Steadfast (the lightest pack tested, 3 passes) 1.49 ms

The brief allowed one only if it could be proven cheaper than vanilla, which these numbers rule out. The design is in the agents' LATER list instead: an opt-in Horizon pack, off by default, with a single composite pass (tonemap + colour grade, no extra targets) and a GPU budget measured against vanilla before it is offered. So #925 closes with the manager. The default pack waits for Ludovic.

Screenshots

Taken in the game (--offscreen + horizon-ctl), with this PR merged with #1157.

Classic Horizon
Empty folder
A pack picked
A pack that fails (Photon)

The world under the menus is unchanged. With no pack picked, the frame is the same as on main (see #1157's screenshots).

Self-check

Run on the Mac mini (macOS, M4 Pro):

  • cargo fmt --all --check: clean.
  • cargo clippy --workspace --all-targets -- -D warnings (with set -o pipefail): exit 0.
  • cargo test -p horizon-shaderpack: 31 passed. New tests:
    • a_define_replaces_an_earlier_one;
    • conditions_read_as_jcpp_does;
    • floats_in_conditions_count_as_their_integer_part;
    • legalises_what_naga_refuses;
    • narrow_fragment_outputs_fill_four_channels.
  • cargo test -p horizon-client: 1,088 passed, 0 failed.
  • tools/parity.py --changed origin/main: run once over origin/main (5aff2980) with both F1 branches merged (#1157 and #1158).
    • 102 harnesses; 85 pass.
    • The other 17 fail the same way on plain main in the same checkout: ambient_sound, music, sound_engine, sound_event, resource_pack, online_mode, locator_bar, dedicated_server, secure_chat, user_cache, world_spawn and the server_* harnesses.
    • For example, ambient_sound stops at the same line 18011 on both. These are environment failures on this machine (the prepared resources have no registries.json, and a CI runner was running the server harnesses at the same time), not caused by these changes.
  • real_packs_load / real_packs_translate with HORIZON_TEST_SHADERPACKS over the ten packs: the five listed as loading load; the rest stop where the table says.

🤖 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/1158 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/shader-pack-folder` --- ### 📝 Commits (2) - [`6ea7a51`](https://github.com/horizon-rust/horizon/commit/6ea7a51ff35983c2082cfa4e002136a461261845) Shader Packs page: the folder's path, Open Folder, a switch per pack - [`ac25d41`](https://github.com/horizon-rust/horizon/commit/ac25d415784c69b3ca0fcd910317329a4daa55d3) Shader Packs page: show the first line of a pack's error ### 📊 Changes **8 files changed** (+465 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/options.rs` (+5 -0) 📝 `crates/horizon-client/src/game/shader_packs.rs` (+7 -4) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+5 -0) 📝 `crates/horizon-client/src/graphics_ui.rs` (+30 -17) 📝 `crates/horizon-client/src/options_horizon.rs` (+159 -8) 📝 `crates/horizon-client/src/options_ui.rs` (+216 -3) 📝 `crates/horizon-client/src/shader_pack.rs` (+31 -1) 📝 `docs/shader-packs.md` (+12 -8) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #941 Fixes #925 The Shader Pack setting was a cycle button. With an empty `shaderpacks/` folder it cycled through a one-entry list and stayed on Off, with no word on where packs go. That is what brabus_ hit on Windows: his pack was in the version folder, but the game reads the game home's `shaderpacks/`. This PR adds a Shader Packs page, the built-in manager asked for in #925, in both menu styles: - **The folder.** The full path of the game home's `shaderpacks/`: - `%APPDATA%\horizon\shaderpacks` on Windows; - `~/Library/Application Support/horizon/shaderpacks` on macOS; - `~/.local/share/horizon/shaderpacks` on Linux. The page also has an **Open Folder** button, which creates the folder if it is missing. - **When the folder is empty**, the page says so: "No shader packs: put a pack's folder or .zip in this folder". - **One switch per pack**, for Horizon packs and Iris/OptiFine packs alike. Picking a pack turns the others off; turning it off gives the vanilla look. The folder is reread at most once a second while the page is open, so a pack dropped in shows up without a restart. - **A pack that fails** keeps its row, marked **Failed** with the first line of the error. Classic menus show `ON (Failed)`. - **Getting there.** - Horizon menus: a "Shader Packs" section in Options. The Graphics page's Shader Pack row opens it. - Classic menus: a "Shader Packs..." button on Video Settings. The Horizon Graphics row opens it. Off stays the default, so nothing changes the vanilla look until a player picks a pack. `docs/shader-packs.md` now gives the folder per OS and describes the page. Thanks to **brabus_ / brabus** for both reports (#941, #925) and to **famescare** for the default-pack idea. ## #925: the default "performance" pack #925 also asks for a Horizon default shader made for performance. This PR does not build one: a pack can't cost less than the vanilla frame. Every Horizon or Iris pack runs full-screen passes on top of the vanilla world pass, so it adds GPU work to every frame. Measured here on the M4 Pro at 1280×720, same scene, renderer GPU timer p50: | Pack | GPU p50 | | --- | --- | | vanilla | 0.01 ms | | BSL | 0.81 ms | | Steadfast (the lightest pack tested, 3 passes) | 1.49 ms | The brief allowed one only if it could be proven cheaper than vanilla, which these numbers rule out. The design is in the agents' LATER list instead: an opt-in Horizon pack, off by default, with a single `composite` pass (tonemap + colour grade, no extra targets) and a GPU budget measured against vanilla before it is offered. So #925 closes with the manager. The default pack waits for Ludovic. ## Screenshots Taken in the game (`--offscreen` + `horizon-ctl`), with this PR merged with #1157. | | Classic | Horizon | | --- | --- | --- | | Empty folder | ![](https://raw.githubusercontent.com/ludovic111/horizon/b26d357f04a1d0847f6ac912fded407a49e2fdaf/f1/ui-classic-empty.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b26d357f04a1d0847f6ac912fded407a49e2fdaf/f1/ui-horizon-empty.png) | | A pack picked | ![](https://raw.githubusercontent.com/ludovic111/horizon/b26d357f04a1d0847f6ac912fded407a49e2fdaf/f1/ui-classic-packs-on.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b26d357f04a1d0847f6ac912fded407a49e2fdaf/f1/ui-horizon-bsl-on.png) | | A pack that fails (Photon) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b26d357f04a1d0847f6ac912fded407a49e2fdaf/f1/ui-classic-failed.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b26d357f04a1d0847f6ac912fded407a49e2fdaf/f1/ui-horizon-failed.png) | The world under the menus is unchanged. With no pack picked, the frame is the same as on `main` (see #1157's screenshots). ## Self-check Run on the Mac mini (macOS, M4 Pro): - `cargo fmt --all --check`: clean. - `cargo clippy --workspace --all-targets -- -D warnings` (with `set -o pipefail`): exit 0. - `cargo test -p horizon-shaderpack`: 31 passed. New tests: - `a_define_replaces_an_earlier_one`; - `conditions_read_as_jcpp_does`; - `floats_in_conditions_count_as_their_integer_part`; - `legalises_what_naga_refuses`; - `narrow_fragment_outputs_fill_four_channels`. - `cargo test -p horizon-client`: 1,088 passed, 0 failed. - `tools/parity.py --changed origin/main`: run once over origin/main (5aff2980) with both F1 branches merged (#1157 and #1158). - 102 harnesses; 85 pass. - The other 17 fail the same way on plain `main` in the same checkout: `ambient_sound`, `music`, `sound_engine`, `sound_event`, `resource_pack`, `online_mode`, `locator_bar`, `dedicated_server`, `secure_chat`, `user_cache`, `world_spawn` and the `server_*` harnesses. - For example, `ambient_sound` stops at the same line 18011 on both. These are environment failures on this machine (the prepared resources have no `registries.json`, and a CI runner was running the server harnesses at the same time), not caused by these changes. - `real_packs_load` / `real_packs_translate` with `HORIZON_TEST_SHADERPACKS` over the ten packs: the five listed as loading load; the rest stop where the table says. 🤖 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:01:33 +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#3104
No description provided.