[PR #1542] [MERGED] Java shader packs: keep the view bob in the view, not the projection #3573

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

📋 Pull Request Information

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

Base: main ← Head: fix/java-pack-bob-in-view


📝 Commits (2)

  • 9c84381 Java shader packs: keep the view bob in the view, not the projection
  • a6e9374 Java shader packs: say where vanilla and Iris put the view bob

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/gfx.rs (+6 -2)

📄 Description

🤖 Opened by an AI agent (DeepSeek V4.1 Flash in OpenCode), not by Excurs1ons.

(AGENTS.md's agent template credits Claude, which is the marker the other agent commits in this repo carry; this PR comes from a different agent, so it is credited as such.)

What

Java packs were given gbufferProjection = world_projection(fov, aspect, far) * bob while gbufferModelView stayed unbobbed. The product projection * view matched what the world was drawn with, so terrain looked right — but a pack never uses the two together: it rebuilds view-space positions from the depth buffer with inverse_projection and then goes to world space with inverse_view (gbufferModelViewInverse, and world_offset/frame.inverse_view in Horizon's own packs). Those two matrices disagreed by the walk bob, so everything a pack rebuilt from depth — screen-space reflections, ambient occlusion, godrays, fog — turned with the bob.

Seen with Complementary Reimagined r5.9.3 on a lake: reflections slid in step with the first-person hand while walking, and the error grew as the FOV changed.

Fix

Put the bob where vanilla and Iris keep it: in the view (the world pose stack), not the projection.

let pack_uniform = shader_pack_uniform(
    frame,
    frame.bob * view,
    world_projection(frame.fov_degrees, aspect, frame.depth_far),
    …
);

projection * view is unchanged, so terrain, entities and the pack's own geometry programs (iris_ModelViewProjectionMatrix) draw exactly as before, while depth reconstruction is now consistent. The hand's uniforms already carried the bob in its pose and are untouched.

Tested

  • Complementary Reimagined r5.9.3, standing and walking, FOV 70 and 110, noon and sunset, at tp -30 66 100 on a lake: reflections stay anchored to the trees at both FOVs instead of turning with the hand.
  • No shader compile warnings in latest.log; frame rate unchanged (Python fast profile, RTX 5070 Ti / Vulkan).

tools/pr_ready.py --quick (Windows, local toolchain rustc 1.97.0). The Scope line counts the untracked shaderpacks/ folder in my working tree (packs downloaded to test with); the commit itself is one file, crates/horizon-client/src/gfx.rs, +7 −2.

**pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-LFIJJ1T, against origin/main at d5bd35025, 3 min 48 s)

| Check | Result |
| --- | --- |
| Scope | ⚠️ 17 files, +596 −2; 598 lines of code: over 500, split it if it can ship in parts |
| Cargo.lock | ✅ unchanged |
| Public tree | ✅ |
| Python tests | ➖ no Python change |
| rustfmt | ✅ (6 s) |
| clippy | ❌ failed (15 s) |
| tests: horizon-client | ❌ 1068 passed, 3 failed (3 min 22 s) |
| doc tests | ✅ 0 passed (3 s) |
| 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) |

Both failures are pre-existing on this machine and reproduce on d5bd3502 without this change:

  • clippy: horizon-world's worldgen/aquifer/noise_based.rs:450 trips clippy::manual_range_contains, which only exists in the local rustc 1.97.0; upstream code predates it.
  • tests: crash::tests::stacks_start_at_the_panicking_frame, packs::cache::tests::directory_inputs_config_and_owned_output_recovery (a PermissionDenied on a temporary file) and save::tests::session_lock_is_exclusive (a Windows sharing violation) fail the same way on main; running the three on a clean d5bd3502 checkout gives 0 passed; 3 failed.

🤖 Generated with OpenCode (model: DeepSeek V4.1 Flash)


🔄 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/1542 **Author:** [@Excurs1ons](https://github.com/Excurs1ons) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/java-pack-bob-in-view` --- ### 📝 Commits (2) - [`9c84381`](https://github.com/horizon-rust/horizon/commit/9c843819b78535791e852b39b9716576e33f2907) Java shader packs: keep the view bob in the view, not the projection - [`a6e9374`](https://github.com/horizon-rust/horizon/commit/a6e9374f88c60a0b2946915ac11cab0b1faf56fc) Java shader packs: say where vanilla and Iris put the view bob ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx.rs` (+6 -2) </details> ### 📄 Description > 🤖 Opened by an AI agent (DeepSeek V4.1 Flash in OpenCode), not by Excurs1ons. _(`AGENTS.md`'s agent template credits Claude, which is the marker the other agent commits in this repo carry; this PR comes from a different agent, so it is credited as such.)_ ## What Java packs were given `gbufferProjection = world_projection(fov, aspect, far) * bob` while `gbufferModelView` stayed unbobbed. The product `projection * view` matched what the world was drawn with, so terrain looked right — but a pack never uses the two together: it rebuilds view-space positions from the depth buffer with `inverse_projection` and then goes to world space with `inverse_view` (`gbufferModelViewInverse`, and `world_offset`/`frame.inverse_view` in Horizon's own packs). Those two matrices disagreed by the walk bob, so everything a pack rebuilt from depth — screen-space reflections, ambient occlusion, godrays, fog — turned with the bob. Seen with Complementary Reimagined r5.9.3 on a lake: reflections slid in step with the first-person hand while walking, and the error grew as the FOV changed. ## Fix Put the bob where vanilla and Iris keep it: in the view (the world pose stack), not the projection. ```rust let pack_uniform = shader_pack_uniform( frame, frame.bob * view, world_projection(frame.fov_degrees, aspect, frame.depth_far), … ); ``` `projection * view` is unchanged, so terrain, entities and the pack's own geometry programs (`iris_ModelViewProjectionMatrix`) draw exactly as before, while depth reconstruction is now consistent. The hand's uniforms already carried the bob in its pose and are untouched. ## Tested - Complementary Reimagined r5.9.3, standing and walking, FOV 70 and 110, noon and sunset, at `tp -30 66 100` on a lake: reflections stay anchored to the trees at both FOVs instead of turning with the hand. - No shader compile warnings in `latest.log`; frame rate unchanged (Python fast profile, RTX 5070 Ti / Vulkan). `tools/pr_ready.py --quick` (Windows, local toolchain rustc 1.97.0). The Scope line counts the untracked `shaderpacks/` folder in my working tree (packs downloaded to test with); the commit itself is one file, `crates/horizon-client/src/gfx.rs`, +7 −2. ``` **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-LFIJJ1T, against origin/main at d5bd35025, 3 min 48 s) | Check | Result | | --- | --- | | Scope | ⚠️ 17 files, +596 −2; 598 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ❌ failed (15 s) | | tests: horizon-client | ❌ 1068 passed, 3 failed (3 min 22 s) | | doc tests | ✅ 0 passed (3 s) | | 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) | ``` Both failures are pre-existing on this machine and reproduce on `d5bd3502` without this change: - **clippy**: `horizon-world`'s `worldgen/aquifer/noise_based.rs:450` trips `clippy::manual_range_contains`, which only exists in the local rustc 1.97.0; upstream code predates it. - **tests**: `crash::tests::stacks_start_at_the_panicking_frame`, `packs::cache::tests::directory_inputs_config_and_owned_output_recovery` (a `PermissionDenied` on a temporary file) and `save::tests::session_lock_is_exclusive` (a Windows sharing violation) fail the same way on `main`; running the three on a clean `d5bd3502` checkout gives `0 passed; 3 failed`. 🤖 Generated with [OpenCode](https://opencode.ai) (model: DeepSeek V4.1 Flash) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:31 +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#3573
No description provided.