[PR #1770] [MERGED] Shader packs, clean room 30: the loader's alpha test #3751

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

📋 Pull Request Information

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

Base: main ← Head: feat/shader-packs-alpha-test


📝 Commits (3)

  • b5a7911 Shader packs, clean room 30: the loader's alpha test
  • 90fe138 Merge branch 'feat/shader-packs-entity-spans' into feat/shader-packs-alpha-test
  • b0fd6e6 Merge feat/shader-packs-entity-spans into feat/shader-packs-alpha-test

📊 Changes

5 files changed (+108 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/gfx/pack_atlas.rs (+1 -0)
📝 crates/horizon-client/src/gfx/pack_sky.rs (+2 -0)
📝 crates/horizon-shaders/src/lib.rs (+1 -1)
📝 crates/horizon-shaders/src/post.rs (+8 -1)
📝 crates/horizon-shaders/src/translate/mod.rs (+96 -1)

📄 Description

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

Shader packs, clean room 30: the loader's alpha test (alphaTest.<program>). Stacked on #1769.

What

  • GbuffersInputs gains alpha_test: the alpha test the loader applies to output 0 (spec 3.2).
  • The translator adds it after the pack's main, only when the program writes gl_FragData/gl_FragColor. With out variables the pack tests alpha itself, so nothing is added.
  • alphaTest.<program> in shaders.properties (off, or a GL comparison and a reference) replaces the geometry's default for that program.
  • Terrain, water and the sky default to no test, as before. So only packs that set the key see a change there: the test packs set GREATER 0.0001–0.005 on water, sky, clouds and block entities, which keeps everything but fully transparent texels.
  • The entities PR (#1771) uses it: entities and block entities default to GREATER 0.1, as cutout.

About 150 lines.

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §3.2 (alphaTest.<program>), OQ-23; no other loader's code read.

How tested

  • Unit test the_alpha_test_discards_below_its_reference: parsing (GREATER 0.1, off, GL_ALWAYS, an unknown function), and the fragment stage gets a discard with gl_FragData and none with an out variable.
  • All four test packs still translate every program they did (real_packs).
  • Seen in game in #1771: Complementary drew a dropped item's transparent texels as a dark square before; now the item is cut out.

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

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

Check Result
Scope ⚠️ 54 files, +9933 −48; 9578 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 ✅ (10 s)
clippy ✅ (34 s)
tests: workspace ✅ 2020 passed (6 min 8 s)
doc tests ✅ 1 passed (31 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 game.rs selects pass on #1769 and on this stack's top. These PRs act only with HORIZON_SHADER_PACK. The Label row is the tool's generic hint: these PRs are skip-release. After this run, a 3-line fix to HORIZON_SHADER_PACK_TIMING's report went into #1771; rustfmt and clippy pass again on the top.

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/1770 **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-alpha-test` --- ### 📝 Commits (3) - [`b5a7911`](https://github.com/horizon-rust/horizon/commit/b5a791170d1e1bec47f2508419d2918c72f891f1) Shader packs, clean room 30: the loader's alpha test - [`90fe138`](https://github.com/horizon-rust/horizon/commit/90fe138e836881088c771c8d8106e090b836c1ba) Merge branch 'feat/shader-packs-entity-spans' into feat/shader-packs-alpha-test - [`b0fd6e6`](https://github.com/horizon-rust/horizon/commit/b0fd6e660e4017e8f936b31ac3432eb760886de4) Merge feat/shader-packs-entity-spans into feat/shader-packs-alpha-test ### 📊 Changes **5 files changed** (+108 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx/pack_atlas.rs` (+1 -0) 📝 `crates/horizon-client/src/gfx/pack_sky.rs` (+2 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+1 -1) 📝 `crates/horizon-shaders/src/post.rs` (+8 -1) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+96 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 30:** the loader's alpha test (`alphaTest.<program>`). Stacked on #1769. ## What - `GbuffersInputs` gains `alpha_test`: the alpha test the loader applies to output 0 (spec 3.2). - The translator adds it after the pack's `main`, only when the program writes `gl_FragData`/`gl_FragColor`. With `out` variables the pack tests alpha itself, so nothing is added. - `alphaTest.<program>` in `shaders.properties` (`off`, or a GL comparison and a reference) replaces the geometry's default for that program. - Terrain, water and the sky default to no test, as before. So only packs that set the key see a change there: the test packs set `GREATER 0.0001`–`0.005` on water, sky, clouds and block entities, which keeps everything but fully transparent texels. - The entities PR (#1771) uses it: entities and block entities default to GREATER 0.1, as cutout. About 150 lines. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §3.2 (`alphaTest.<program>`), OQ-23; no other loader's code read. ## How tested - Unit test `the_alpha_test_discards_below_its_reference`: parsing (`GREATER 0.1`, `off`, `GL_ALWAYS`, an unknown function), and the fragment stage gets a `discard` with `gl_FragData` and none with an `out` variable. - All four test packs still translate every program they did (`real_packs`). - Seen in game in #1771: Complementary drew a dropped item's transparent texels as a dark square before; now the item is cut out. ## Self-check (whole stack, on its top branch `feat/shader-packs-entities`) **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 4a675206b, 7 min 24 s) | Check | Result | | --- | --- | | Scope | ⚠️ 54 files, +9933 −48; 9578 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 | ✅ (10 s) | | clippy | ✅ (34 s) | | tests: workspace | ✅ 2020 passed (6 min 8 s) | | doc tests | ✅ 1 passed (31 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 `game.rs` selects pass on #1769 and on this stack's top. These PRs act only with `HORIZON_SHADER_PACK`. The Label row is the tool's generic hint: these PRs are `skip-release`. After this run, a 3-line fix to `HORIZON_SHADER_PACK_TIMING`'s report went into #1771; rustfmt and clippy pass again on the top. ## 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:03 +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#3751
No description provided.