[PR #1008] [MERGED] Give Java packs' full-screen passes Iris's sky, eye light and custom uniforms #2983

Closed
opened 2026-11-02 16:00:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/java-pack-fullscreen-inputs


📝 Commits (1)

  • 0431f12 Give Java packs' full-screen passes Iris's sky, eye light and custom uniforms

📊 Changes

12 files changed (+1239 additions, -40 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+43 -14)
📝 crates/horizon-client/src/game/render_tick.rs (+7 -1)
📝 crates/horizon-client/src/game/shader_packs.rs (+9 -0)
📝 crates/horizon-client/src/gfx.rs (+8 -0)
📝 crates/horizon-client/src/gfx/java_stages.rs (+180 -18)
📝 crates/horizon-client/src/java_pack.rs (+19 -2)
📝 crates/horizon-shaderpack/src/lib.rs (+1 -0)
📝 crates/horizon-shaderpack/src/pipeline.rs (+55 -0)
📝 crates/horizon-shaderpack/src/properties.rs (+53 -0)
➕ crates/horizon-shaderpack/src/uniforms.rs (+838 -0)
📝 crates/horizon-shaderpack/tests/pack.rs (+8 -0)
📝 docs/shader-packs.md (+18 -5)

📄 Description

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

Fixes #944, reported on Discord by brabus_ (Complementary Unbound r5.8: clouds and sun rays inside terrain underground, flickering clouds, a black second sun).

Only the full-screen passes run (no gbuffers_* or shadow, as the brief says). Here is what those passes got wrong:

Input Before Now (Iris 26.x)
eyeBrightness always (0, 240), so open sky even underground block and sky light × 16 at the camera entity's eye block (CommonUniforms.getEyeBrightness)
eyeBrightnessSmooth same constant follows it with the pack's eyeBrightnessHalflife (SmoothedFloat)
custom uniforms (uniform.* / variable.*) all 0: Complementary's eyeBrightnessM, isEyeInCave, starter, framemod8, rainFactor... parsed and evaluated each frame (new horizon_shaderpack::uniforms: stareval's priorities, IrisFunctions, smooth = SmoothFloat)
sunPosition, moonPosition, shadowLightPosition, sunAngle, shadowAngle a sun vector pointing north–south, no sunPathRotation CelestialUniforms: the sky's sun_angle / moon_angle, Y -90, the pack's sunPathRotation about Z, then the angle
vanilla sky while the pack runs untilted sun; vanilla clouds drawn and writing depth sunPathRotation tilts Horizon's sun, moon and stars as Iris tilts vanilla's; clouds = off | fast | fancy and sun / moon = false apply (ShaderProperties)

Unbound (and Reimagined, and Sildur's) set clouds = off. Horizon drew the vanilla clouds anyway, and their depth made the packs' light shafts and fog treat them as terrain: dark streaks fanned out from the sun, and clouds showed in the spectator x-ray view. Unbound's sun sits on its -40° path. Horizon's untilted vanilla sun did not, and its lighting and glow came from a sun vector rotated 90°.

Proof

  • horizon-client gfx::java_stages::celestial_and_eye_uniforms_follow_iris: at noon with sunPathRotation = -40, sunPosition equals Unbound's own GetSunVector(). The test also covers the sunrise and night positions, sunAngle, shadowAngle, shadowLightPosition (the moon at night), eyeBrightness from the eye light, and custom uniforms coming after Iris's own. On main, sunPosition at sunrise pointed north and eyeBrightness was constant.

  • horizon-shaderpack uniforms::tests (operators and priorities, functions, dependency order, broken and circular definitions, smooth half-lives) and pipeline::tests::sky_directives_last_one_wins.

  • HORIZON_TEST_SHADERPACKS with the four dev-only test packs: every custom uniform of Unbound r5.8, Reimagined r5.9.3, BSL v10.1.8 and Sildur's 2.02 parses. Unbound, Reimagined and Sildur's have clouds = off.

  • Unbound r5.8 on the Mac mini (Metal, offscreen), before and after, same world and views:

    • Sunset: before, dark ray streaks fanned out of the vanilla clouds toward the sun. After, the clouds are gone and the sky is clean.
    • Sun at 2000 ticks: after, it is tilted onto the pack's path.
    • Spectator inside stone at y 40: eyeBrightness reads (0, 0) (checked with horizon-ctl light). Looking up shows the pack's dark cave fog, with no clouds or shafts.
    • A sealed room lit by a torch: dark, torch-lit.

    Screenshots aren't attached (the pack's licence).

  • Harnesses: tools/parity.py cloud_render environment_render weather_render all PASS. Without a Java pack the vanilla paths are unchanged: tilt 0, the player's cloud option.

Self-check (Mac mini)

cargo fmt --all --check                                                    ok
cargo clippy -p horizon-shaderpack -p horizon-client --all-targets -D warnings   ok
cargo test -p horizon-shaderpack                                           all pass
cargo test -p horizon-client --lib                                         923 passed
tools/parity.py cloud_render environment_render weather_render             PASS

Not done here

  • No shadows or the pack's own sky/sun/clouds: those come from gbuffers_* and shadow, still planned.
  • Not checked: the black second sun on brabus_'s Windows/Vulkan machine. I couldn't reproduce it on Metal. Likely causes this PR removes: the untilted vanilla sun next to the pack's tilted light direction, and the rotated sun vector. It still needs a check on Windows with Unbound.
  • Not checked: the cloud flicker. The flickering vanilla clouds are no longer drawn under these packs.
  • Not provided yet, so the custom uniforms that use them stay 0, as Iris does for names it can't resolve: biome, biome_precipitation, blindness and similar. In Unbound that covers inDry/inRainy/inSnowy and the Nether biome blends.

Needs Ludovic: nothing. A Windows run with Unbound would confirm the black sun is gone.

🤖 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/1008 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/java-pack-fullscreen-inputs` --- ### 📝 Commits (1) - [`0431f12`](https://github.com/horizon-rust/horizon/commit/0431f12a6f91143c0d74c8c89ffa6d93e23d1bac) Give Java packs' full-screen passes Iris's sky, eye light and custom uniforms ### 📊 Changes **12 files changed** (+1239 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+43 -14) 📝 `crates/horizon-client/src/game/render_tick.rs` (+7 -1) 📝 `crates/horizon-client/src/game/shader_packs.rs` (+9 -0) 📝 `crates/horizon-client/src/gfx.rs` (+8 -0) 📝 `crates/horizon-client/src/gfx/java_stages.rs` (+180 -18) 📝 `crates/horizon-client/src/java_pack.rs` (+19 -2) 📝 `crates/horizon-shaderpack/src/lib.rs` (+1 -0) 📝 `crates/horizon-shaderpack/src/pipeline.rs` (+55 -0) 📝 `crates/horizon-shaderpack/src/properties.rs` (+53 -0) ➕ `crates/horizon-shaderpack/src/uniforms.rs` (+838 -0) 📝 `crates/horizon-shaderpack/tests/pack.rs` (+8 -0) 📝 `docs/shader-packs.md` (+18 -5) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #944, reported on Discord by brabus_ (Complementary Unbound r5.8: clouds and sun rays inside terrain underground, flickering clouds, a black second sun). Only the full-screen passes run (no `gbuffers_*` or `shadow`, as the brief says). Here is what those passes got wrong: | Input | Before | Now (Iris 26.x) | | --- | --- | --- | | `eyeBrightness` | always `(0, 240)`, so open sky even underground | block and sky light × 16 at the camera entity's eye block (`CommonUniforms.getEyeBrightness`) | | `eyeBrightnessSmooth` | same constant | follows it with the pack's `eyeBrightnessHalflife` (`SmoothedFloat`) | | custom uniforms (`uniform.*` / `variable.*`) | all 0: Complementary's `eyeBrightnessM`, `isEyeInCave`, `starter`, `framemod8`, `rainFactor`... | parsed and evaluated each frame (new `horizon_shaderpack::uniforms`: stareval's priorities, `IrisFunctions`, `smooth` = `SmoothFloat`) | | `sunPosition`, `moonPosition`, `shadowLightPosition`, `sunAngle`, `shadowAngle` | a sun vector pointing north–south, no `sunPathRotation` | `CelestialUniforms`: the sky's `sun_angle` / `moon_angle`, Y -90, the pack's `sunPathRotation` about Z, then the angle | | vanilla sky while the pack runs | untilted sun; vanilla clouds drawn and writing depth | `sunPathRotation` tilts Horizon's sun, moon and stars as Iris tilts vanilla's; `clouds = off \| fast \| fancy` and `sun` / `moon = false` apply (`ShaderProperties`) | Unbound (and Reimagined, and Sildur's) set `clouds = off`. Horizon drew the vanilla clouds anyway, and their depth made the packs' light shafts and fog treat them as terrain: dark streaks fanned out from the sun, and clouds showed in the spectator x-ray view. Unbound's sun sits on its `-40°` path. Horizon's untilted vanilla sun did not, and its lighting and glow came from a sun vector rotated 90°. ## Proof - `horizon-client` `gfx::java_stages::celestial_and_eye_uniforms_follow_iris`: at noon with `sunPathRotation = -40`, `sunPosition` equals Unbound's own `GetSunVector()`. The test also covers the sunrise and night positions, `sunAngle`, `shadowAngle`, `shadowLightPosition` (the moon at night), `eyeBrightness` from the eye light, and custom uniforms coming after Iris's own. On main, `sunPosition` at sunrise pointed north and `eyeBrightness` was constant. - `horizon-shaderpack` `uniforms::tests` (operators and priorities, functions, dependency order, broken and circular definitions, `smooth` half-lives) and `pipeline::tests::sky_directives_last_one_wins`. - `HORIZON_TEST_SHADERPACKS` with the four dev-only test packs: every custom uniform of Unbound r5.8, Reimagined r5.9.3, BSL v10.1.8 and Sildur's 2.02 parses. Unbound, Reimagined and Sildur's have `clouds = off`. - Unbound r5.8 on the Mac mini (Metal, offscreen), before and after, same world and views: - Sunset: before, dark ray streaks fanned out of the vanilla clouds toward the sun. After, the clouds are gone and the sky is clean. - Sun at 2000 ticks: after, it is tilted onto the pack's path. - Spectator inside stone at y 40: `eyeBrightness` reads `(0, 0)` (checked with `horizon-ctl light`). Looking up shows the pack's dark cave fog, with no clouds or shafts. - A sealed room lit by a torch: dark, torch-lit. Screenshots aren't attached (the pack's licence). - Harnesses: `tools/parity.py cloud_render environment_render weather_render` all PASS. Without a Java pack the vanilla paths are unchanged: tilt 0, the player's cloud option. ## Self-check (Mac mini) ``` cargo fmt --all --check ok cargo clippy -p horizon-shaderpack -p horizon-client --all-targets -D warnings ok cargo test -p horizon-shaderpack all pass cargo test -p horizon-client --lib 923 passed tools/parity.py cloud_render environment_render weather_render PASS ``` ## Not done here - No shadows or the pack's own sky/sun/clouds: those come from `gbuffers_*` and `shadow`, still planned. - Not checked: the black second sun on brabus_'s Windows/Vulkan machine. I couldn't reproduce it on Metal. Likely causes this PR removes: the untilted vanilla sun next to the pack's tilted light direction, and the rotated sun vector. It still needs a check on Windows with Unbound. - Not checked: the cloud flicker. The flickering vanilla clouds are no longer drawn under these packs. - Not provided yet, so the custom uniforms that use them stay 0, as Iris does for names it can't resolve: `biome`, `biome_precipitation`, `blindness` and similar. In Unbound that covers `inDry`/`inRainy`/`inSnowy` and the Nether biome blends. Needs Ludovic: nothing. A Windows run with Unbound would confirm the black sun is gone. 🤖 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 16:00:37 +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#2983
No description provided.