[PR #1697] [MERGED] Shader packs, clean room 13: loading the terrain program #3696

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

📋 Pull Request Information

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

Base: main ← Head: feat/shader-packs-terrain


📝 Commits (1)

  • 8698b4a Shader packs, clean room 13: loading the terrain program

📊 Changes

5 files changed (+173 additions, -64 deletions)

View changed files

📝 crates/horizon-client/src/game/shader_packs.rs (+1 -1)
📝 crates/horizon-shaders/src/post.rs (+125 -60)
📝 crates/horizon-shaders/src/translate/mod.rs (+12 -0)
📝 crates/horizon-shaders/src/translate/rewrite.rs (+19 -0)
📝 crates/horizon-shaders/tests/real_packs.rs (+16 -3)

📄 Description

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

Shader packs, clean room 13 (slice 6c): loading the terrain program. Stacked on #1670.

What

  • load_post takes the game's terrain vertex inputs (GbuffersInputs) and, given them, loads the first program of gbuffers_terrain's fallback chain that translates (gbuffers_terrain, gbuffers_textured_lit, gbuffers_textured, gbuffers_basic). Post-processing and gbuffers programs share one loader (enable expressions, flips, buffer settings, notes).
  • The translator no longer rewrites a variable, parameter or member that has a sampler's name (float specular beside uniform sampler2D specular), which kept Complementary's gbuffers programs from compiling.

About 240 lines. Nothing draws with it yet (next PR).

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §2.1 (fallback chain), §5.1; no other loader's code read.

How tested

Unit tests locals_may_hide_a_sampler and the post loader's tests; the public test packs (black box, tests/real_packs.rs): BSL and both Complementary versions load gbuffers_terrain in every dimension folder.

Self-check (whole stack, on its top branch feat/shader-packs-real-buffers)

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 07e46daa5, 7 min 3 s)

Check Result
Scope ⚠️ 41 files, +6862 −25; 6553 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (4 s)
clippy ✅ (24 s)
tests: workspace ✅ 1974 passed (5 min 47 s)
doc tests ✅ 1 passed (47 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Parity: 326 harnesses selected (the root Cargo.toml and gfx.rs earlier in the stack); CI runs them. Nothing here acts without HORIZON_SHADER_PACK. The Label row is the tool's generic hint: these PRs are skip-release.

Needs Ludovic

Nothing. Label skip-release: it runs only behind HORIZON_SHADER_PACK.

🤖 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/1697 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-terrain` --- ### 📝 Commits (1) - [`8698b4a`](https://github.com/horizon-rust/horizon/commit/8698b4ad0c7f3d0ec3f21f45efe14a9f750d84bb) Shader packs, clean room 13: loading the terrain program ### 📊 Changes **5 files changed** (+173 additions, -64 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/shader_packs.rs` (+1 -1) 📝 `crates/horizon-shaders/src/post.rs` (+125 -60) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+12 -0) 📝 `crates/horizon-shaders/src/translate/rewrite.rs` (+19 -0) 📝 `crates/horizon-shaders/tests/real_packs.rs` (+16 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 13 (slice 6c):** loading the terrain program. Stacked on #1670. ## What - `load_post` takes the game's terrain vertex inputs (`GbuffersInputs`) and, given them, loads the first program of `gbuffers_terrain`'s fallback chain that translates (`gbuffers_terrain`, `gbuffers_textured_lit`, `gbuffers_textured`, `gbuffers_basic`). Post-processing and gbuffers programs share one loader (enable expressions, flips, buffer settings, notes). - The translator no longer rewrites a variable, parameter or member that has a sampler's name (`float specular` beside `uniform sampler2D specular`), which kept Complementary's gbuffers programs from compiling. About 240 lines. Nothing draws with it yet (next PR). ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §2.1 (fallback chain), §5.1; no other loader's code read. ## How tested Unit tests `locals_may_hide_a_sampler` and the post loader's tests; the public test packs (black box, `tests/real_packs.rs`): BSL and both Complementary versions load `gbuffers_terrain` in every dimension folder. ## Self-check (whole stack, on its top branch `feat/shader-packs-real-buffers`) **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 07e46daa5, 7 min 3 s) | Check | Result | | --- | --- | | Scope | ⚠️ 41 files, +6862 −25; 6553 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (4 s) | | clippy | ✅ (24 s) | | tests: workspace | ✅ 1974 passed (5 min 47 s) | | doc tests | ✅ 1 passed (47 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Parity: 326 harnesses selected (the root `Cargo.toml` and `gfx.rs` earlier in the stack); CI runs them. Nothing here acts without `HORIZON_SHADER_PACK`. The Label row is the tool's generic hint: these PRs are `skip-release`. ## Needs Ludovic Nothing. Label `skip-release`: it runs only behind `HORIZON_SHADER_PACK`. 🤖 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 04:11: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#3696
No description provided.