[PR #1712] [MERGED] Shader packs, clean room 18: translucent terrain drawn by the pack #3707

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

📋 Pull Request Information

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

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


📝 Commits (10+)

  • 6c8880f Shader packs, clean room 15: globals initialized at run time, switch options
  • 505e8e9 Shader packs, clean room 16: custom uniforms
  • a2ec3fc Shader packs, clean room 17: real packs' buffers and samplers
  • 3e2c30a Shader packs, clean room 18: translucent terrain drawn by the pack
  • 754437f Merge branch 'feat/shader-packs-terrain-draw' into feat/shader-packs-run-globals
  • aebc95f Merge branch 'feat/shader-packs-run-globals' into feat/shader-packs-custom-uniforms
  • bf5c7e4 Merge branch 'feat/shader-packs-custom-uniforms' into feat/shader-packs-real-buffers
  • 60e8ec3 Merge branch 'feat/shader-packs-real-buffers' into feat/shader-packs-water
  • b73ca49 Merge feat/shader-packs-terrain-draw into feat/shader-packs-run-globals
  • ff3d57e Merge feat/shader-packs-run-globals into feat/shader-packs-custom-uniforms

📊 Changes

11 files changed (+1436 additions, -135 deletions)

View changed files

📝 crates/horizon-client/src/gfx.rs (+28 -7)
📝 crates/horizon-client/src/gfx/pack_post.rs (+392 -98)
📝 crates/horizon-client/src/gfx/pack_uniforms.rs (+57 -0)
➕ crates/horizon-shaders/src/custom.rs (+570 -0)
📝 crates/horizon-shaders/src/lib.rs (+7 -1)
➕ crates/horizon-shaders/src/options.rs (+80 -0)
📝 crates/horizon-shaders/src/pack.rs (+33 -0)
📝 crates/horizon-shaders/src/post.rs (+150 -7)
📝 crates/horizon-shaders/src/translate/mod.rs (+15 -0)
📝 crates/horizon-shaders/src/translate/scan.rs (+95 -21)
📝 crates/horizon-shaders/tests/real_packs.rs (+9 -1)

📄 Description

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

Shader packs, clean room 18 (slice 6h): translucent terrain drawn by the pack. Stacked on #1701.

What

  • With a pack whose gbuffers_water (or a fallback down gbuffers_terrain's chain) loads, translucent terrain (water, stained glass) is drawn by it after the deferred programs and before the composites (§2.1), in place, in the game's back-to-front order. Horizon's own translucent terrain draw is skipped only in that case.
  • blend.<program>: off or four GL factors. Translucent terrain defaults to SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ONE_MINUS_SRC_ALPHA (§3.2), and only blendable buffer formats blend.
  • depthtex1/depthtex2: depth without translucent terrain. A copy is taken just before it, and only when a later program reads them; before it, they are depthtex0 itself. The hand is drawn after the pack, so depthtex2 = depthtex1.

About 330 lines.

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §2.1, §2.3, §3.2 (blend.*), §6.2 (depthtex1/2); no other loader's code read.

How tested

  • Unit test water_falls_back_to_terrain_and_blends (fallback, default blend, blend.* parsing including off); sampler_names covers depthtex2.
  • Screenshots (local; the packs' licences forbid sharing them): BSL draws its own water with its reflections on both single-player paths; Horizon's terrain-test pack draws water through gbuffers_terrain with the default blend.

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

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

Check Result
Scope ⚠️ 42 files, +7461 −25; 7151 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 ✅ (6 s)
clippy ✅ (26 s)
tests: workspace ✅ 1975 passed (7 min 47 s)
doc tests ✅ 1 passed (57 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/1712 **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-water` --- ### 📝 Commits (10+) - [`6c8880f`](https://github.com/horizon-rust/horizon/commit/6c8880fbd887a69af1f12acc5f2f9c3b64cbec85) Shader packs, clean room 15: globals initialized at run time, switch options - [`505e8e9`](https://github.com/horizon-rust/horizon/commit/505e8e960f9956a51bde92a52b737d4f7f413c69) Shader packs, clean room 16: custom uniforms - [`a2ec3fc`](https://github.com/horizon-rust/horizon/commit/a2ec3fc791e773c69b852922ca53af1be298cd47) Shader packs, clean room 17: real packs' buffers and samplers - [`3e2c30a`](https://github.com/horizon-rust/horizon/commit/3e2c30a852452a3ee0a4cf778d85aee55b98c205) Shader packs, clean room 18: translucent terrain drawn by the pack - [`754437f`](https://github.com/horizon-rust/horizon/commit/754437fac663ae71ca7dd456a7a814018e27bf46) Merge branch 'feat/shader-packs-terrain-draw' into feat/shader-packs-run-globals - [`aebc95f`](https://github.com/horizon-rust/horizon/commit/aebc95fd00fc4f05b7694b33d18a6636aea2a32a) Merge branch 'feat/shader-packs-run-globals' into feat/shader-packs-custom-uniforms - [`bf5c7e4`](https://github.com/horizon-rust/horizon/commit/bf5c7e4ff2ed11c8c4c3d18a9c49c8b0f956d76e) Merge branch 'feat/shader-packs-custom-uniforms' into feat/shader-packs-real-buffers - [`60e8ec3`](https://github.com/horizon-rust/horizon/commit/60e8ec326ad06c3110f1127f5f3289afbd5843f4) Merge branch 'feat/shader-packs-real-buffers' into feat/shader-packs-water - [`b73ca49`](https://github.com/horizon-rust/horizon/commit/b73ca494a8db302713135f58ef22c2e986cab604) Merge feat/shader-packs-terrain-draw into feat/shader-packs-run-globals - [`ff3d57e`](https://github.com/horizon-rust/horizon/commit/ff3d57ea9c7986bc57ecdb2586f360274c7c1acc) Merge feat/shader-packs-run-globals into feat/shader-packs-custom-uniforms ### 📊 Changes **11 files changed** (+1436 additions, -135 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx.rs` (+28 -7) 📝 `crates/horizon-client/src/gfx/pack_post.rs` (+392 -98) 📝 `crates/horizon-client/src/gfx/pack_uniforms.rs` (+57 -0) ➕ `crates/horizon-shaders/src/custom.rs` (+570 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+7 -1) ➕ `crates/horizon-shaders/src/options.rs` (+80 -0) 📝 `crates/horizon-shaders/src/pack.rs` (+33 -0) 📝 `crates/horizon-shaders/src/post.rs` (+150 -7) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+15 -0) 📝 `crates/horizon-shaders/src/translate/scan.rs` (+95 -21) 📝 `crates/horizon-shaders/tests/real_packs.rs` (+9 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 18 (slice 6h):** translucent terrain drawn by the pack. Stacked on #1701. ## What - With a pack whose `gbuffers_water` (or a fallback down `gbuffers_terrain`'s chain) loads, translucent terrain (water, stained glass) is drawn by it after the deferred programs and before the composites (§2.1), in place, in the game's back-to-front order. Horizon's own translucent terrain draw is skipped only in that case. - `blend.<program>`: `off` or four GL factors. Translucent terrain defaults to `SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ONE_MINUS_SRC_ALPHA` (§3.2), and only blendable buffer formats blend. - `depthtex1`/`depthtex2`: depth without translucent terrain. A copy is taken just before it, and only when a later program reads them; before it, they are `depthtex0` itself. The hand is drawn after the pack, so `depthtex2` = `depthtex1`. About 330 lines. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §2.1, §2.3, §3.2 (`blend.*`), §6.2 (`depthtex1/2`); no other loader's code read. ## How tested - Unit test `water_falls_back_to_terrain_and_blends` (fallback, default blend, `blend.*` parsing including `off`); `sampler_names` covers `depthtex2`. - Screenshots (local; the packs' licences forbid sharing them): BSL draws its own water with its reflections on both single-player paths; Horizon's `terrain-test` pack draws water through `gbuffers_terrain` with the default blend. ## Self-check (whole stack, on its top branch `feat/shader-packs-mipmaps`) **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 07e46daa5, 9 min 16 s) | Check | Result | | --- | --- | | Scope | ⚠️ 42 files, +7461 −25; 7151 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 | ✅ (6 s) | | clippy | ✅ (26 s) | | tests: workspace | ✅ 1975 passed (7 min 47 s) | | doc tests | ✅ 1 passed (57 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:35 +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#3707
No description provided.