[PR #1267] [MERGED] Java shader packs: Photon, Chocapic13' and MakeUp Ultra Fast load #3469

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

📋 Pull Request Information

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

Base: main ← Head: feat/java-packs-photon-chocapic


📝 Commits (4)

  • 60fc787 Java shader packs: Photon, Chocapic13' and MakeUp Ultra Fast load
  • 91d89b4 Java shader packs: modf into a vector component works in an initialiser
  • f642105 Merge remote-tracking branch 'origin/main' into feat/java-packs-photon-chocapic
  • ab2bc22 Merge origin/main into feat/java-packs-photon-chocapic

📊 Changes

5 files changed (+365 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/java_pack.rs (+22 -0)
📝 crates/horizon-shaderpack/src/properties.rs (+24 -2)
📝 crates/horizon-shaderpack/src/translate.rs (+236 -23)
📝 crates/horizon-shaderpack/tests/translate.rs (+72 -0)
📝 docs/shader-packs.md (+11 -2)

📄 Description

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

Engine-side work that helps the Java path (shaders-1, phase 3): before porting Photon, Chocapic13' and MakeUp Ultra Fast to Horizon packs, their Java originals have to run, both to compare against and because players pick them as they are. None of the three loaded; now all three do, and so does Bliss up to a later point.

What changed

horizon-shaderpack's legaliser handles what these packs write that GL accepts and naga doesn't:

  • texture2D and its kin without a level outside fragment shaders become textureLod(.., 0). This stopped Chocapic13', MakeUp and Bliss: naga forbids implicit derivatives in vertex shaders.
  • A struct passed between stages (Photon's flat out CloudsParameters) travels as one varying per field, with matrices split by column and arrays by element. The struct global stays where it is declared.
  • textureGather, which naga's GLSL front end doesn't have, is emulated: four texelFetches in GL's order.
  • A bool given to a numeric constructor (vec3(r < radius), Photon's sun disc) becomes cond ? 1.0 : 0.0.
  • const in parameters (Bliss) lose the const.
  • Array fields of private structs get their natural stride. naga lays every struct out as std140, so Photon's ACES SegmentedSplineParamsC5(.., float[6](..)) didn't validate.
  • modf into a vector component assigns the component. WGSL can't take &v.y, and naga's WGSL writer emitted it anyway.
  • shaders.properties keeps the empty lines the preprocessor leaves, so Photon's ) \ before #else ends its value instead of swallowing variable.float.blue_hour.

java_pack::tests::real_packs_load now also parses every translated program again as WGSL, which is what wgpu receives. That check found the modf case.

Results (M4 Pro, default options, HORIZON_TEST_SHADERPACKS)

Pack Before Now
Photon v1.4 fails (struct varying) loads: 27 passes. It draws black, because it lights the scene from the G-buffer its gbuffers_* write and Horizon doesn't run those yet
Chocapic13' V9 High fails (vertex lookup) drawn: 16 passes, its grade and fog over Horizon's world
MakeUp Ultra Fast 9.6 fails (vertex lookup) drawn: 6 passes; without its gbuffers_* its fog covers everything
Bliss 2.1.2 fails (vertex lookup) gets further: a vector component passed to an inout parameter is next
BSL, Complementary Reimagined/Unbound, Sildur's, Steadfast load still load

Wide view at 1000 / 6000 / 12400 / 18000 ticks (vanilla, then Chocapic13', MakeUp, Photon):

vanilla
Chocapic13' via the Java path
MakeUp via the Java path
Photon via the Java path: black

Frame time on the Java path (M4 Pro, 1280x720, noon still view, 20 s, fast build; the Mac mini was busy with other work, so these are rough): vanilla 1.29 ms p50, Photon 3.93, Chocapic13' 3.22, MakeUp 2.11. These are the baselines the hand ports will be compared against.

Checks

  • cargo test -p horizon-shaderpack passes, including the new legalises_what_photon_and_chocapic_write and the continued-value case in the properties test.
  • real_packs_load passes for every pack in the table except Bliss, Bloop, Noble and Rethinking Voxels, as before.
  • cargo clippy -p horizon-shaderpack --all-targets and -p horizon-client --lib --tests are clean.
  • No pack files are committed: they are dev-only test inputs, as before.

🤖 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/1267 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/java-packs-photon-chocapic` --- ### 📝 Commits (4) - [`60fc787`](https://github.com/horizon-rust/horizon/commit/60fc787288ab5d5ebf89cacb61b72b3c4151094b) Java shader packs: Photon, Chocapic13' and MakeUp Ultra Fast load - [`91d89b4`](https://github.com/horizon-rust/horizon/commit/91d89b4abfdac7a1664854aa008efdc9c19e2c3a) Java shader packs: modf into a vector component works in an initialiser - [`f642105`](https://github.com/horizon-rust/horizon/commit/f642105e84f57e79d818ea9b4ef5024be0a74e6f) Merge remote-tracking branch 'origin/main' into feat/java-packs-photon-chocapic - [`ab2bc22`](https://github.com/horizon-rust/horizon/commit/ab2bc22515719ca5ad0d3e1061abec2fcfb3c495) Merge origin/main into feat/java-packs-photon-chocapic ### 📊 Changes **5 files changed** (+365 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/java_pack.rs` (+22 -0) 📝 `crates/horizon-shaderpack/src/properties.rs` (+24 -2) 📝 `crates/horizon-shaderpack/src/translate.rs` (+236 -23) 📝 `crates/horizon-shaderpack/tests/translate.rs` (+72 -0) 📝 `docs/shader-packs.md` (+11 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Engine-side work that helps the Java path (shaders-1, phase 3): before porting Photon, Chocapic13' and MakeUp Ultra Fast to Horizon packs, their Java originals have to run, both to compare against and because players pick them as they are. None of the three loaded; now all three do, and so does Bliss up to a later point. ## What changed `horizon-shaderpack`'s legaliser handles what these packs write that GL accepts and naga doesn't: - `texture2D` and its kin **without a level outside fragment shaders** become `textureLod(.., 0)`. This stopped Chocapic13', MakeUp and Bliss: naga forbids implicit derivatives in vertex shaders. - **A struct passed between stages** (Photon's `flat out CloudsParameters`) travels as one varying per field, with matrices split by column and arrays by element. The struct global stays where it is declared. - **`textureGather`**, which naga's GLSL front end doesn't have, is emulated: four `texelFetch`es in GL's order. - **A `bool` given to a numeric constructor** (`vec3(r < radius)`, Photon's sun disc) becomes `cond ? 1.0 : 0.0`. - **`const in` parameters** (Bliss) lose the `const`. - **Array fields of private structs** get their natural stride. naga lays every struct out as std140, so Photon's ACES `SegmentedSplineParamsC5(.., float[6](..))` didn't validate. - **`modf` into a vector component** assigns the component. WGSL can't take `&v.y`, and naga's WGSL writer emitted it anyway. - **`shaders.properties`** keeps the empty lines the preprocessor leaves, so Photon's `) \` before `#else` ends its value instead of swallowing `variable.float.blue_hour`. `java_pack::tests::real_packs_load` now also parses every translated program again as WGSL, which is what wgpu receives. That check found the `modf` case. ## Results (M4 Pro, default options, `HORIZON_TEST_SHADERPACKS`) | Pack | Before | Now | | --- | --- | --- | | Photon v1.4 | fails (struct varying) | loads: 27 passes. It draws black, because it lights the scene from the G-buffer its `gbuffers_*` write and Horizon doesn't run those yet | | Chocapic13' V9 High | fails (vertex lookup) | drawn: 16 passes, its grade and fog over Horizon's world | | MakeUp Ultra Fast 9.6 | fails (vertex lookup) | drawn: 6 passes; without its `gbuffers_*` its fog covers everything | | Bliss 2.1.2 | fails (vertex lookup) | gets further: a vector component passed to an `inout` parameter is next | | BSL, Complementary Reimagined/Unbound, Sildur's, Steadfast | load | still load | Wide view at 1000 / 6000 / 12400 / 18000 ticks (vanilla, then Chocapic13', MakeUp, Photon): ![vanilla](https://raw.githubusercontent.com/ludovic111/horizon/3b869fe8d5ac8d63478c350e8faaa8477be1ec1a/shaders-1/java_vanilla.jpg) ![Chocapic13' via the Java path](https://raw.githubusercontent.com/ludovic111/horizon/3b869fe8d5ac8d63478c350e8faaa8477be1ec1a/shaders-1/java_jchoca.jpg) ![MakeUp via the Java path](https://raw.githubusercontent.com/ludovic111/horizon/3b869fe8d5ac8d63478c350e8faaa8477be1ec1a/shaders-1/java_jmakeup.jpg) ![Photon via the Java path: black](https://raw.githubusercontent.com/ludovic111/horizon/3b869fe8d5ac8d63478c350e8faaa8477be1ec1a/shaders-1/java_jphoton.jpg) Frame time on the Java path (M4 Pro, 1280x720, noon still view, 20 s, fast build; the Mac mini was busy with other work, so these are rough): vanilla 1.29 ms p50, Photon 3.93, Chocapic13' 3.22, MakeUp 2.11. These are the baselines the hand ports will be compared against. ## Checks - `cargo test -p horizon-shaderpack` passes, including the new `legalises_what_photon_and_chocapic_write` and the continued-value case in the properties test. - `real_packs_load` passes for every pack in the table except Bliss, Bloop, Noble and Rethinking Voxels, as before. - `cargo clippy -p horizon-shaderpack --all-targets` and `-p horizon-client --lib --tests` are clean. - No pack files are committed: they are dev-only test inputs, as before. 🤖 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:09:45 +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#3469
No description provided.