[PR #4906] [MERGED] Shader packs: sunPathRotation and the shadow camera as Iris has them #5933

Closed
opened 2026-11-03 05:16:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4906
Author: @TobiasLogic
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: shaderpacks/iris-shadow-camera


📝 Commits (1)

  • d01ff3b Shader packs: sunPathRotation and the shadow camera as Iris has them

📊 Changes

1 file changed (+67 additions, -32 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx/pack_uniforms.rs (+67 -32)

📄 Description

🤖 Opened by TobiasLogic's AI agent (Claude Code, Claude Opus 5.5), not by TobiasLogic personally.

What and why

Fixes #4905.

Two things shader packs get from Horizon differed from what Iris gives them. Both were measured by running packs in Minecraft 26.3 with Iris 1.11.7 and in Horizon on the same world and camera: a probe pack writes the uniforms into the frame as float bits, and the two frames are decoded and compared. Iris's source was not read.

  • sunPathRotation: tilt_matrix turned the sun's path toward +Z; Iris turns it toward -Z (noon at 30 degrees: (0, 86.6, -50) before the view transform). The sky pass uses the same matrix, so the drawn sun follows.
  • The shadow camera: Iris's shadowModelView undoes the tilt, turns about Z by the light's angle from the zenith, then 90 degrees about X. Its origin is interval / 2 - camera % interval on each world axis (the remainder keeps the camera's sign). The 100-block offset toward the light is in shadowProjection, not the model-view, and the orthographic depths run from -near to far. Horizon used look_to_rh from 128 blocks along the light and snapped in the shadow view's own axes, so both matrices differed from Iris's even where their product was close. Packs that use them separately (reprojecting into the shadow map, rebuilding positions) saw a different light.

the_shadow_camera_matches_iris checks both matrices against the values Iris gave at 3000 ticks with sunPathRotation = 30. The two existing tests change to the new conventions.

Related open work: #4441-#4453 don't touch tilt_matrix or shadow_camera (#4446 and #4448 change other parts of pack_uniforms.rs). #3702 copies the old snapping into its shadow cache key, so after this it should follow shadow_camera's origin.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Not vanilla: the shaders/ pack format. The reference is Iris 1.11.7 on Minecraft 26.3, run and observed with probe packs (no source read).

Self-check

pr_ready (tools/pr_ready.py --quick on 6cd182588f2d, against origin/main at 3c580814c, 6 min 57 s)

Check Result
Scope ✅ 1 files, +67 −32
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 458 run, FAILED (errors=17) (2 min 43 s)
rustfmt ✅ (22 s)
clippy ✅ (3 min 9 s)
tests: horizon-client-render ✅ 597 passed (37 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Run on a rented Linux box (80 cores, Tesla P100), GPU tests on lavapipe: with the NVIDIA driver headless there, GPU tests this doesn't touch (gfx::arena, gfx::upload, gfx::end_sky, ...) hung. The Python tests fail only on that box's Python 3.10 and git 2.34 (tomllib, hashlib.file_digest, git merge-tree --write-tree): with Python 3.11 477 of 481 pass there, and the other 4 (test_nightly_set, test_supervise) pass with git 2.55.

Screenshots

BSL v10.1.8 (sunPathRotation = -40), superflat test world, 3000 ticks. With the tilt the right way, the faces Iris leaves in shade (the stone block, the log) are in shade, and shadows fall where Iris casts them: the chest's and the log's to their right, the stone's over the near side of the pool. The water, leaves and grass still differ for other reasons.

BSL: Iris, Horizon main, Horizon main with this PR

🤖 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/4906 **Author:** [@TobiasLogic](https://github.com/TobiasLogic) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `shaderpacks/iris-shadow-camera` --- ### 📝 Commits (1) - [`d01ff3b`](https://github.com/horizon-rust/horizon/commit/d01ff3b8a4e567dcedb3de3f076decb6a5959168) Shader packs: sunPathRotation and the shadow camera as Iris has them ### 📊 Changes **1 file changed** (+67 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx/pack_uniforms.rs` (+67 -32) </details> ### 📄 Description > 🤖 Opened by TobiasLogic's AI agent (Claude Code, Claude Opus 5.5), not by TobiasLogic personally. ## What and why Fixes #4905. Two things shader packs get from Horizon differed from what Iris gives them. Both were measured by running packs in Minecraft 26.3 with Iris 1.11.7 and in Horizon on the same world and camera: a probe pack writes the uniforms into the frame as float bits, and the two frames are decoded and compared. Iris's source was not read. - **`sunPathRotation`**: `tilt_matrix` turned the sun's path toward +Z; Iris turns it toward -Z (noon at 30 degrees: `(0, 86.6, -50)` before the view transform). The sky pass uses the same matrix, so the drawn sun follows. - **The shadow camera**: Iris's `shadowModelView` undoes the tilt, turns about Z by the light's angle from the zenith, then 90 degrees about X. Its origin is `interval / 2 - camera % interval` on each world axis (the remainder keeps the camera's sign). The 100-block offset toward the light is in `shadowProjection`, not the model-view, and the orthographic depths run from `-near` to `far`. Horizon used `look_to_rh` from 128 blocks along the light and snapped in the shadow view's own axes, so both matrices differed from Iris's even where their product was close. Packs that use them separately (reprojecting into the shadow map, rebuilding positions) saw a different light. `the_shadow_camera_matches_iris` checks both matrices against the values Iris gave at 3000 ticks with `sunPathRotation = 30`. The two existing tests change to the new conventions. Related open work: #4441-#4453 don't touch `tilt_matrix` or `shadow_camera` (#4446 and #4448 change other parts of `pack_uniforms.rs`). #3702 copies the old snapping into its shadow cache key, so after this it should follow `shadow_camera`'s origin. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Not vanilla: the `shaders/` pack format. The reference is Iris 1.11.7 on Minecraft 26.3, run and observed with probe packs (no source read). ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 6cd182588f2d, against origin/main at 3c580814c, 6 min 57 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +67 −32 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 458 run, FAILED (errors=17) (2 min 43 s) | | rustfmt | ✅ (22 s) | | clippy | ✅ (3 min 9 s) | | tests: horizon-client-render | ✅ 597 passed (37 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Run on a rented Linux box (80 cores, Tesla P100), GPU tests on lavapipe: with the NVIDIA driver headless there, GPU tests this doesn't touch (`gfx::arena`, `gfx::upload`, `gfx::end_sky`, ...) hung. The Python tests fail only on that box's Python 3.10 and git 2.34 (`tomllib`, `hashlib.file_digest`, `git merge-tree --write-tree`): with Python 3.11 477 of 481 pass there, and the other 4 (`test_nightly_set`, `test_supervise`) pass with git 2.55. ## Screenshots BSL v10.1.8 (`sunPathRotation = -40`), superflat test world, 3000 ticks. With the tilt the right way, the faces Iris leaves in shade (the stone block, the log) are in shade, and shadows fall where Iris casts them: the chest's and the log's to their right, the stone's over the near side of the pool. The water, leaves and grass still differ for other reasons. ![BSL: Iris, Horizon main, Horizon main with this PR](https://raw.githubusercontent.com/TobiasLogic/horizon/pr-assets/pr1-bsl.png) 🤖 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 05:16:01 +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#5933
No description provided.