[PR #1786] [MERGED] Shader packs, clean room 34: rain and snow #3759

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

📋 Pull Request Information

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

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


📝 Commits (10+)

  • b5a7911 Shader packs, clean room 30: the loader's alpha test
  • ab289a2 Shader packs, clean room 31: entities and block entities
  • 3a7d00a Shader packs, clean room 32: translucent entity parts and particles
  • abe7047 Shader packs, clean room 33: clouds
  • 173463a Shader packs, clean room 34: rain and snow
  • 90fe138 Merge branch 'feat/shader-packs-entity-spans' into feat/shader-packs-alpha-test
  • c4856e6 Merge branch 'feat/shader-packs-alpha-test' into feat/shader-packs-entities
  • 257654e Merge branch 'feat/shader-packs-entities' into feat/shader-packs-translucent-entities
  • c395797 Merge branch 'feat/shader-packs-translucent-entities' into feat/shader-packs-clouds
  • 612024e Merge branch 'feat/shader-packs-clouds' into feat/shader-packs-weather

📊 Changes

16 files changed (+1505 additions, -26 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -3)
📝 crates/horizon-client/src/game/names.rs (+4 -0)
📝 crates/horizon-client/src/game/shader_packs.rs (+13 -0)
📝 crates/horizon-client/src/gfx.rs (+77 -9)
📝 crates/horizon-client/src/gfx/pack_atlas.rs (+1 -0)
📝 crates/horizon-client/src/gfx/pack_draw.rs (+2 -0)
➕ crates/horizon-client/src/gfx/pack_entities.rs (+462 -0)
📝 crates/horizon-client/src/gfx/pack_post.rs (+337 -5)
📝 crates/horizon-client/src/gfx/pack_sky.rs (+2 -0)
📝 crates/horizon-client/src/gfx/pack_timing.rs (+2 -1)
➕ crates/horizon-client/src/gfx/pack_weather.rs (+264 -0)
📝 crates/horizon-shaders/src/lib.rs (+1 -1)
📝 crates/horizon-shaders/src/post.rs (+198 -4)
📝 crates/horizon-shaders/src/translate/mod.rs (+125 -1)
📝 crates/horizon-shaders/src/translate/rewrite.rs (+7 -0)
📝 crates/horizon-shaders/tests/real_packs.rs (+7 -2)

📄 Description

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

Shader packs, clean room 34: a pack draws rain and snow. Stacked on #1785. This closes the second group of slice 7 (#1784–#1786); the group's checks are below.

What

  • gbuffers_weather (→ textured_lit → textured → basic, spec 2.3) draws the game's rain and snow after translucent terrain and the late entity parts. It blends with the translucent default and uses vanilla's 0.1 alpha cut (OQ-23).
  • Vertices: the weather quads become entity vertices (camera-relative position, colour with vanilla's fade, light). Weather has no normal, so the pack sees +Y.
  • UV animation is applied on the CPU, and only on this path. It is the same phase Horizon's weather shader computes; a test checks it against the game's weather columns bit for bit.
  • Textures: rain and snow each read a copy of their sprite through a repeating sampler. A pack's texture then repeats down the column as vanilla's standalone rain and snow textures do, which an atlas cannot. The copies are made once, and again only when the sprite moves.
    • This needs COPY_SRC on the shared atlas: a usage flag only, with no effect on Horizon's own draws.
  • Without a shader pack nothing changes: Horizon's weather draw is skipped only when the pack draws it.

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §2.1, §2.3, OQ-23; no other loader's code read.

How tested

  • Unit tests: phase_matches_the_weather_columns, and the weather chain in water_falls_back_to_terrain_and_blends.
  • In game (screenshots local; the packs' licences forbid uploading them): BSL and Complementary draw rain at spawn and snow in a snowy taiga; both are textured, repeat down the column and animate.

Group checks (#1784–#1786)

  • A/B without a pack (village scene, RD 16, 720p, Mac mini, 5 alternating paired runs, #1771's binary against this branch):

    #1771 this branch
    CPU p50 (median) 0.453 ms 0.461 ms
    GPU p50 (median) 0.786 ms 0.785 ms

    Both are within noise. Horizon's entity, cloud and weather draws are still one call each.

  • Screenshots without a pack (#1771 against this branch): the static views are identical within run-to-run noise. That covers a day view and named mobs with their name tags and shadows. Rain differs only by its animation phase.

  • Parity: the 30 harnesses that game.rs, game/names.rs and game/shader_packs.rs select pass. The gfx files select about 108; CI runs them.

  • lan_e2e (host in-frame, and on its server thread): self, nametags, chest, hurt, objects, cracks and looks pass.

  • Overhead with a pack (HORIZON_SHADER_PACK_TIMING, village, RD 16, 720p):

    • BSL: world copy 0.043–0.049 ms; its clouds program costs 0.017 ms.
    • Complementary: its per-pass "world" time reads 0.23 ms instead of 0.12 ms, but frame GPU p50 is unchanged (3.5–3.9 ms on #1771, 32, 33 and 34).
      • The shift comes from #1785 skipping Horizon's own cloud draw. A local copy of Complementary without gbuffers_clouds, on this branch, measures 0.12 ms again at the same frame GPU p50.
      • So no work was added: GPU time moved between the passes' timestamps.
      • Complementary stays over the 0.1 ms target until the copy pass is removed.

Self-check (whole stack, on this branch)

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 4a675206b, 20 min 3 s)

Check Result
Scope ⚠️ 56 files, +10708 −51; 10354 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 ✅ (12 s)
clippy ✅ (2 min 27 s)
tests: workspace ✅ 2022 passed (15 min 5 s)
doc tests ✅ 1 passed (2 min 18 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, because the root Cargo.toml and gfx.rs change earlier in the stack; CI runs them. Locally, the 30 harnesses this group's game files select pass. These PRs act only with HORIZON_SHADER_PACK. The Label row is the tool's generic hint: these PRs are skip-release.

Needs Ludovic

Nothing. Label skip-release: players see no change.

🤖 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/1786 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-weather` --- ### 📝 Commits (10+) - [`b5a7911`](https://github.com/horizon-rust/horizon/commit/b5a791170d1e1bec47f2508419d2918c72f891f1) Shader packs, clean room 30: the loader's alpha test - [`ab289a2`](https://github.com/horizon-rust/horizon/commit/ab289a2cf3f84fac470eb146e140c2fa7dc55f67) Shader packs, clean room 31: entities and block entities - [`3a7d00a`](https://github.com/horizon-rust/horizon/commit/3a7d00a74c3202242356b31ef94a53e8b4478fba) Shader packs, clean room 32: translucent entity parts and particles - [`abe7047`](https://github.com/horizon-rust/horizon/commit/abe7047d1947e12225a8baa120b8f4b86ace0a70) Shader packs, clean room 33: clouds - [`173463a`](https://github.com/horizon-rust/horizon/commit/173463acdf4fa73f15089567bf2152a235ed328e) Shader packs, clean room 34: rain and snow - [`90fe138`](https://github.com/horizon-rust/horizon/commit/90fe138e836881088c771c8d8106e090b836c1ba) Merge branch 'feat/shader-packs-entity-spans' into feat/shader-packs-alpha-test - [`c4856e6`](https://github.com/horizon-rust/horizon/commit/c4856e6febb28aeb6faa06c4c2ea6e5cf8c73c8a) Merge branch 'feat/shader-packs-alpha-test' into feat/shader-packs-entities - [`257654e`](https://github.com/horizon-rust/horizon/commit/257654ef30b6ead67be08b5128428ff057a54229) Merge branch 'feat/shader-packs-entities' into feat/shader-packs-translucent-entities - [`c395797`](https://github.com/horizon-rust/horizon/commit/c39579772c2c89ce3fa01ba181ca521731393220) Merge branch 'feat/shader-packs-translucent-entities' into feat/shader-packs-clouds - [`612024e`](https://github.com/horizon-rust/horizon/commit/612024eff4affb80d93ea0b8165699e8af46d0b3) Merge branch 'feat/shader-packs-clouds' into feat/shader-packs-weather ### 📊 Changes **16 files changed** (+1505 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -3) 📝 `crates/horizon-client/src/game/names.rs` (+4 -0) 📝 `crates/horizon-client/src/game/shader_packs.rs` (+13 -0) 📝 `crates/horizon-client/src/gfx.rs` (+77 -9) 📝 `crates/horizon-client/src/gfx/pack_atlas.rs` (+1 -0) 📝 `crates/horizon-client/src/gfx/pack_draw.rs` (+2 -0) ➕ `crates/horizon-client/src/gfx/pack_entities.rs` (+462 -0) 📝 `crates/horizon-client/src/gfx/pack_post.rs` (+337 -5) 📝 `crates/horizon-client/src/gfx/pack_sky.rs` (+2 -0) 📝 `crates/horizon-client/src/gfx/pack_timing.rs` (+2 -1) ➕ `crates/horizon-client/src/gfx/pack_weather.rs` (+264 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+1 -1) 📝 `crates/horizon-shaders/src/post.rs` (+198 -4) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+125 -1) 📝 `crates/horizon-shaders/src/translate/rewrite.rs` (+7 -0) 📝 `crates/horizon-shaders/tests/real_packs.rs` (+7 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 34:** a pack draws rain and snow. Stacked on #1785. This closes the second group of slice 7 (#1784–#1786); the group's checks are below. ## What - **`gbuffers_weather`** (→ `textured_lit` → `textured` → `basic`, spec 2.3) draws the game's rain and snow after translucent terrain and the late entity parts. It blends with the translucent default and uses vanilla's 0.1 alpha cut (OQ-23). - **Vertices:** the weather quads become entity vertices (camera-relative position, colour with vanilla's fade, light). Weather has no normal, so the pack sees +Y. - **UV animation** is applied on the CPU, and only on this path. It is the same phase Horizon's weather shader computes; a test checks it against the game's weather columns bit for bit. - **Textures:** rain and snow each read a copy of their sprite through a repeating sampler. A pack's `texture` then repeats down the column as vanilla's standalone rain and snow textures do, which an atlas cannot. The copies are made once, and again only when the sprite moves. - This needs `COPY_SRC` on the shared atlas: a usage flag only, with no effect on Horizon's own draws. - **Without a shader pack** nothing changes: Horizon's weather draw is skipped only when the pack draws it. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §2.1, §2.3, OQ-23; no other loader's code read. ## How tested - **Unit tests:** `phase_matches_the_weather_columns`, and the weather chain in `water_falls_back_to_terrain_and_blends`. - **In game** (screenshots local; the packs' licences forbid uploading them): BSL and Complementary draw rain at spawn and snow in a snowy taiga; both are textured, repeat down the column and animate. ## Group checks (#1784–#1786) - **A/B without a pack** (village scene, RD 16, 720p, Mac mini, 5 alternating paired runs, #1771's binary against this branch): | | #1771 | this branch | |---|---|---| | CPU p50 (median) | 0.453 ms | 0.461 ms | | GPU p50 (median) | 0.786 ms | 0.785 ms | Both are within noise. Horizon's entity, cloud and weather draws are still one call each. - **Screenshots without a pack** (#1771 against this branch): the static views are identical within run-to-run noise. That covers a day view and named mobs with their name tags and shadows. Rain differs only by its animation phase. - **Parity:** the 30 harnesses that `game.rs`, `game/names.rs` and `game/shader_packs.rs` select pass. The `gfx` files select about 108; CI runs them. - **lan_e2e** (host in-frame, and on its server thread): `self`, `nametags`, `chest`, `hurt`, `objects`, `cracks` and `looks` pass. - **Overhead with a pack** (`HORIZON_SHADER_PACK_TIMING`, village, RD 16, 720p): - **BSL:** world copy 0.043–0.049 ms; its clouds program costs 0.017 ms. - **Complementary:** its per-pass "world" time reads 0.23 ms instead of 0.12 ms, but frame GPU p50 is unchanged (3.5–3.9 ms on #1771, 32, 33 and 34). - The shift comes from #1785 skipping Horizon's own cloud draw. A local copy of Complementary without `gbuffers_clouds`, on this branch, measures 0.12 ms again at the same frame GPU p50. - So no work was added: GPU time moved between the passes' timestamps. - Complementary stays over the 0.1 ms target until the copy pass is removed. ## Self-check (whole stack, on this branch) **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 4a675206b, 20 min 3 s) | Check | Result | | --- | --- | | Scope | ⚠️ 56 files, +10708 −51; 10354 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 | ✅ (12 s) | | clippy | ✅ (2 min 27 s) | | tests: workspace | ✅ 2022 passed (15 min 5 s) | | doc tests | ✅ 1 passed (2 min 18 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, because the root `Cargo.toml` and `gfx.rs` change earlier in the stack; CI runs them. Locally, the 30 harnesses this group's game files select pass. These PRs act only with `HORIZON_SHADER_PACK`. The Label row is the tool's generic hint: these PRs are `skip-release`. ## Needs Ludovic Nothing. Label `skip-release`: players see no change. 🤖 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:12:06 +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#3759
No description provided.