[PR #415] [MERGED] horizon-shaderpack: read shaders.properties like Iris #2547

Closed
opened 2026-11-02 15:57:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/shaderpack-properties


📝 Commits (3)

  • b22583d horizon-shaderpack: open Java shader packs and preprocess them like Iris
  • 98ebdca horizon-shaderpack: translate Java shader pack programs to WGSL
  • 38a9f65 horizon-shaderpack: read shaders.properties like Iris

📊 Changes

19 files changed (+4669 additions, -7 deletions)

View changed files

📝 Cargo.lock (+395 -6)
📝 Cargo.toml (+1 -1)
➕ crates/horizon-shaderpack/Cargo.toml (+20 -0)
➕ crates/horizon-shaderpack/src/include.rs (+198 -0)
➕ crates/horizon-shaderpack/src/lib.rs (+161 -0)
➕ crates/horizon-shaderpack/src/options.rs (+659 -0)
➕ crates/horizon-shaderpack/src/preprocess.rs (+332 -0)
➕ crates/horizon-shaderpack/src/properties.rs (+783 -0)
➕ crates/horizon-shaderpack/src/source.rs (+141 -0)
➕ crates/horizon-shaderpack/src/translate.rs (+1297 -0)
➕ crates/horizon-shaderpack/tests/fixtures/mini/shaders/composite.fsh (+10 -0)
➕ crates/horizon-shaderpack/tests/fixtures/mini/shaders/composite.vsh (+3 -0)
➕ crates/horizon-shaderpack/tests/fixtures/mini/shaders/lib/common.glsl (+7 -0)
➕ crates/horizon-shaderpack/tests/fixtures/mini/shaders/lib/settings.glsl (+7 -0)
➕ crates/horizon-shaderpack/tests/fixtures/mini/shaders/notes.txt (+1 -0)
➕ crates/horizon-shaderpack/tests/fixtures/mini/shaders/world-1/composite.fsh (+4 -0)
➕ crates/horizon-shaderpack/tests/pack.rs (+278 -0)
➕ crates/horizon-shaderpack/tests/translate.rs (+356 -0)
📝 docs/shader-packs.md (+16 -0)

📄 Description

Stacked on #413 (GLSL → WGSL), which is stacked on #405 (preprocessor). Step 2 of the order in docs/shader-packs.md.

What it does

horizon_shaderpack::properties reads a pack's shaders.properties the way Iris does:

  • Java .properties syntax (continuations, escapes, :/=/space separators, last key wins).
  • Two reads, as in Iris: the raw file for screen.*, sliders and profile.*, and a preprocessed one for everything else. The preprocessed read defines the enabled boolean options as 1, the environment's macros (MC_VERSION, MC_OS_*, …) and the string option values. A #define may redefine a name, as JCPP allows.
  • Option screens (screen, screen.<name>, [sub], <profile>, <empty>, *), columns, sliders, iris.features.required/optional.
  • Profiles (profile.<name>, !program.X, nested profile.Y) and the current profile, matched the way Iris's ProfileSet does.
  • program.<name>.enabled through a port of Iris's BooleanParser: unknown names count as true, and so do malformed expressions.
  • image.<name> formats. These feed the translator's Link::image_formats, so writeonly images without a format get the pack's.
  • blend.<program> and blend.<program>.<buffer> overrides.
  • JavaPack::properties(values, env) and program_name(program) (the path without its extension, which is what the properties use).

Nothing in the client uses it yet. The option screen and the full-screen passes come next.

How it was verified

  • Unit tests cover Java syntax, the boolean expressions, both reads (an MC_OS_MAC redefinition, size.buffer.*, profiles, the current profile, a program disabled by a profile, image formats, blends) and the earlier fixture tests. cargo fmt, cargo clippy -p horizon-shaderpack --all-targets -D warnings and cargo test -p horizon-shaderpack all pass.
  • Real packs (dev only, never committed: HORIZON_TEST_SHADERPACKS=<folder>):
Pack Screens Profiles (current) Off by default Translated
Complementary Reimagined r5.9.3 14 main elements, 50 sub-screens, 162 sliders 8 (HIGH) world*/shadowcomp 180/180
BSL v10.1.8 14, 66, 251 5 (HIGH) composite2/3, nether composite1/shadow, shadowcomp 154/154
Sildur's Vibrant 2.02 Extreme 18, 14, 47 none none 114/114

Sildur's main screen names one option it no longer defines (IRIS_END_FIX). Iris shows such an option as an empty cell.

  • With their colored lighting on, BSL's shadowcomp.csh translates with the rgba16f light images, and so do all 183 of Complementary's programs on Linux with IRIS_FEATURE_CUSTOM_IMAGES defined.

What is left

  • An option screen in the client: the data it needs is here.
  • deferred*/composite*/final full-screen passes, with colour targets, size.buffer, and buffer formats from const int colortexNFormat.
  • customTexture.*, texture.*, uniform.*/variable.* (custom uniforms), alphaTest.*, scale.*/flip.* are parsed as plain properties but nothing interprets them yet.

Needs Ludovic

  • Which IRIS_FEATURE_* Horizon claims. Without CUSTOM_IMAGES, Complementary declares no voxel images but still turns its shadowcomp on (when colored lighting is on), so it fails. Packs expect the feature flags to match what the renderer can do, so I'd only define each one when the stage behind it lands.

🤖 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/415 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shaderpack-properties` --- ### 📝 Commits (3) - [`b22583d`](https://github.com/horizon-rust/horizon/commit/b22583d0577f83652e275b4560de483ab42594d8) horizon-shaderpack: open Java shader packs and preprocess them like Iris - [`98ebdca`](https://github.com/horizon-rust/horizon/commit/98ebdcad7b27100b569ca55b717507e2dd896bbc) horizon-shaderpack: translate Java shader pack programs to WGSL - [`38a9f65`](https://github.com/horizon-rust/horizon/commit/38a9f6543f8e8ed8c00a844fc64751f507ab6b0e) horizon-shaderpack: read shaders.properties like Iris ### 📊 Changes **19 files changed** (+4669 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+395 -6) 📝 `Cargo.toml` (+1 -1) ➕ `crates/horizon-shaderpack/Cargo.toml` (+20 -0) ➕ `crates/horizon-shaderpack/src/include.rs` (+198 -0) ➕ `crates/horizon-shaderpack/src/lib.rs` (+161 -0) ➕ `crates/horizon-shaderpack/src/options.rs` (+659 -0) ➕ `crates/horizon-shaderpack/src/preprocess.rs` (+332 -0) ➕ `crates/horizon-shaderpack/src/properties.rs` (+783 -0) ➕ `crates/horizon-shaderpack/src/source.rs` (+141 -0) ➕ `crates/horizon-shaderpack/src/translate.rs` (+1297 -0) ➕ `crates/horizon-shaderpack/tests/fixtures/mini/shaders/composite.fsh` (+10 -0) ➕ `crates/horizon-shaderpack/tests/fixtures/mini/shaders/composite.vsh` (+3 -0) ➕ `crates/horizon-shaderpack/tests/fixtures/mini/shaders/lib/common.glsl` (+7 -0) ➕ `crates/horizon-shaderpack/tests/fixtures/mini/shaders/lib/settings.glsl` (+7 -0) ➕ `crates/horizon-shaderpack/tests/fixtures/mini/shaders/notes.txt` (+1 -0) ➕ `crates/horizon-shaderpack/tests/fixtures/mini/shaders/world-1/composite.fsh` (+4 -0) ➕ `crates/horizon-shaderpack/tests/pack.rs` (+278 -0) ➕ `crates/horizon-shaderpack/tests/translate.rs` (+356 -0) 📝 `docs/shader-packs.md` (+16 -0) </details> ### 📄 Description Stacked on #413 (GLSL → WGSL), which is stacked on #405 (preprocessor). Step 2 of the order in `docs/shader-packs.md`. ## What it does `horizon_shaderpack::properties` reads a pack's `shaders.properties` the way Iris does: - Java `.properties` syntax (continuations, escapes, `:`/`=`/space separators, last key wins). - Two reads, as in Iris: the raw file for `screen.*`, `sliders` and `profile.*`, and a preprocessed one for everything else. The preprocessed read defines the enabled boolean options as `1`, the environment's macros (`MC_VERSION`, `MC_OS_*`, …) and the string option values. A `#define` may redefine a name, as JCPP allows. - Option screens (`screen`, `screen.<name>`, `[sub]`, `<profile>`, `<empty>`, `*`), columns, sliders, `iris.features.required/optional`. - Profiles (`profile.<name>`, `!program.X`, nested `profile.Y`) and the current profile, matched the way Iris's `ProfileSet` does. - `program.<name>.enabled` through a port of Iris's `BooleanParser`: unknown names count as true, and so do malformed expressions. - `image.<name>` formats. These feed the translator's `Link::image_formats`, so `writeonly` images without a format get the pack's. - `blend.<program>` and `blend.<program>.<buffer>` overrides. - `JavaPack::properties(values, env)` and `program_name(program)` (the path without its extension, which is what the properties use). Nothing in the client uses it yet. The option screen and the full-screen passes come next. ## How it was verified - Unit tests cover Java syntax, the boolean expressions, both reads (an `MC_OS_MAC` redefinition, `size.buffer.*`, profiles, the current profile, a program disabled by a profile, image formats, blends) and the earlier fixture tests. `cargo fmt`, `cargo clippy -p horizon-shaderpack --all-targets -D warnings` and `cargo test -p horizon-shaderpack` all pass. - Real packs (dev only, never committed: `HORIZON_TEST_SHADERPACKS=<folder>`): | Pack | Screens | Profiles (current) | Off by default | Translated | |---|---|---|---|---| | Complementary Reimagined r5.9.3 | 14 main elements, 50 sub-screens, 162 sliders | 8 (HIGH) | `world*/shadowcomp` | 180/180 | | BSL v10.1.8 | 14, 66, 251 | 5 (HIGH) | `composite2/3`, nether `composite1`/`shadow`, `shadowcomp` | 154/154 | | Sildur's Vibrant 2.02 Extreme | 18, 14, 47 | none | none | 114/114 | Sildur's main screen names one option it no longer defines (`IRIS_END_FIX`). Iris shows such an option as an empty cell. - With their colored lighting on, BSL's `shadowcomp.csh` translates with the `rgba16f` light images, and so do all 183 of Complementary's programs on Linux with `IRIS_FEATURE_CUSTOM_IMAGES` defined. ## What is left - An option screen in the client: the data it needs is here. - `deferred*`/`composite*`/`final` full-screen passes, with colour targets, `size.buffer`, and buffer formats from `const int colortexNFormat`. - `customTexture.*`, `texture.*`, `uniform.*`/`variable.*` (custom uniforms), `alphaTest.*`, `scale.*`/`flip.*` are parsed as plain properties but nothing interprets them yet. ## Needs Ludovic - Which `IRIS_FEATURE_*` Horizon claims. Without `CUSTOM_IMAGES`, Complementary declares no voxel images but still turns its `shadowcomp` on (when colored lighting is on), so it fails. Packs expect the feature flags to match what the renderer can do, so I'd only define each one when the stage behind it lands. 🤖 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-02 15:57: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#2547
No description provided.