From 9c843819b78535791e852b39b9716576e33f2907 Mon Sep 17 00:00:00 2001 From: JasonGu <1456970218@qq.com> Date: Sat, 24 Oct 2026 15:45:14 +0800 Subject: [PATCH 1/2] Java shader packs: keep the view bob in the view, not the projection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A pack rebuilds view positions from the depth buffer with `inverse_projection` and then multiplies by `inverse_view` (`gbufferModelViewInverse`), and Horizon's own packs do the same through `world_offset` and `frame.inverse_view`. Passing `world_projection(fov, aspect, far) * bob` as the projection while `view` stayed unbobbed left the two halves disagreeing by the walk bob, so everything a pack reconstructed — reflections, ambient occlusion, godrays — turned with the bob. That reads as reflections wobbling in step with the first-person hand, and changing the FOV made it worse. Vanilla and Iris carry the bob in the world's pose stack (the model-view matrix), not in the projection. Pass `bob * view` as the view and the plain world projection instead: `projection * view` is unchanged, so terrain, entities and the pack's own geometry programs draw as before, while depth reconstruction is now consistent. The hand's uniforms already carried the bob in its pose and are untouched. Checked with Complementary Reimagined r5.9.3 over the depth-feedback passes at 70 and 110 FOV. Co-Authored-By: DeepSeek V4.1 Flash (OpenCode agent) --- crates/horizon-client/src/gfx.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/gfx.rs b/crates/horizon-client/src/gfx.rs index e951f4d58..cb2ead3f6 100644 --- a/crates/horizon-client/src/gfx.rs +++ b/crates/horizon-client/src/gfx.rs @@ -3402,10 +3402,15 @@ impl Renderer { }; self.uploads .buffer(&mut encoder, &self.globals, 0, bytemuck::bytes_of(&globals)); + // Vanilla keeps the view bob in the world's PoseStack, not in the + // projection, and packs reconstruct view positions from the depth + // buffer and multiply by `inverse_view` (`gbufferModelViewInverse`): + // with the bob in the projection instead, everything they rebuild — + // reflections, AO, godrays — slid along with the walk bob. let pack_uniform = shader_pack_uniform( frame, - view, - world_projection(frame.fov_degrees, aspect, frame.depth_far) * frame.bob, + frame.bob * view, + world_projection(frame.fov_degrees, aspect, frame.depth_far), sun, fog_color, globals.fog, From a6e9374f88c60a0b2946915ac11cab0b1faf56fc Mon Sep 17 00:00:00 2001 From: Ludovic Marie Date: Sat, 24 Oct 2026 11:30:12 +0200 Subject: [PATCH 2/2] Java shader packs: say where vanilla and Iris put the view bob Vanilla 26.3 multiplies bobHurt/bobView into the projection (GameRenderer.renderLevel); Iris's MixinModelViewBobbing moves them into the model-view when a pack is in use. The comment said vanilla keeps the bob in the PoseStack, which is Iris's behaviour, not vanilla's. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/gfx.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/horizon-client/src/gfx.rs b/crates/horizon-client/src/gfx.rs index cb2ead3f6..59a3b5d03 100644 --- a/crates/horizon-client/src/gfx.rs +++ b/crates/horizon-client/src/gfx.rs @@ -3402,11 +3402,10 @@ impl Renderer { }; self.uploads .buffer(&mut encoder, &self.globals, 0, bytemuck::bytes_of(&globals)); - // Vanilla keeps the view bob in the world's PoseStack, not in the - // projection, and packs reconstruct view positions from the depth - // buffer and multiply by `inverse_view` (`gbufferModelViewInverse`): - // with the bob in the projection instead, everything they rebuild — - // reflections, AO, godrays — slid along with the walk bob. + // Vanilla multiplies the bob into the projection (GameRenderer.renderLevel); + // Iris moves it into the model-view for packs (MixinModelViewBobbing), whose + // depth reconstruction expects a plain perspective `gbufferProjection`. + // `projection * view` is the same either way. let pack_uniform = shader_pack_uniform( frame, frame.bob * view,