[PR #1119] [MERGED] Boats: the water patch hides water inside the hull; the riding camera turns smoothly #3065

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

📋 Pull Request Information

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

Base: main ← Head: fix/boat-water-patch


📝 Commits (1)

  • e3cea08 Boats: the water patch hides water inside the hull; the riding camera turns smoothly

📊 Changes

5 files changed (+118 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/entity.wgsl (+5 -0)
📝 crates/horizon-client/src/game/boats.rs (+20 -0)
📝 crates/horizon-client/src/game/perspective.rs (+9 -1)
📝 crates/horizon-client/src/gfx.rs (+68 -12)
📝 crates/horizon-client/src/gfx/entity_batch.rs (+16 -7)

📄 Description

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

Fixes #1016. Reported by @Doopz93: water shows inside a boat, and riding one turns the camera in steps.

What and why

  1. Water inside the hull. Vanilla BoatRenderer draws the model's water_patch part with RenderTypes.waterMask() (depth only, no colour) unless the boat is under water, before translucent terrain, so the water surface fails the depth test inside the hull. Rafts have no patch. Horizon never drew it.
    • New entity overlay code WATER_MASK_OVERLAY (13) gets its own batch bucket; water_mask_pipeline writes depth only (fs_water_mask, no colour writes) and is drawn after the entity and crumbling batches, before translucent terrain.
    • boats.rs draws minecraft:boat#water_patch with the hull's transform when the boat isn't a raft and isn't under (flowing) water.
  2. Choppy turning. AbstractBoat.positionRider adds the boat's deltaRotation to the rider's yRot only, so yRotO lags by that turn and getViewYRot interpolates across it every frame. Horizon's camera used the current yaw as yRotO, so the view snapped once per tick. camera_view now sets y_rot_o = yaw - delta_rotation while riding a boat.

Screenshots (oak boat on still water, same camera)

main this PR

Self-check (all five B2 branches merged onto one integration commit, Mac mini)

  • On the branches rebased onto origin/main 252f877f:
  • cargo fmt --all -- --check: clean
  • set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings: exit 0
  • cargo test -p horizon-assets -p horizon-client: all pass (960 + 84 + smaller suites, 0 failed)
  • tools/parity.py --changed origin/main (integration over e66c35b2): 238 of 268 harnesses PASS, including block_particles, particle_providers, emitter_particles, entity_particles, item_particles, marker_particles, entity_model, item_model, environment_render, section_mesh, translucency, block_entity_render, cloud_render, weather_render, world_border_render, sprite_animation, living_fluid. 1 FAIL: dedicated_server, which also fails on plain origin/main (--fresh, same machine; its server-timing lines differ from run to run under load). 29 non-rendering harnesses (server, sound, UI screens) were not reached locally before the run's time limit; CI runs them.
  • Screenshot comparison: main vs this branch from the same world, camera and commands (--offscreen + horizon-ctl screenshot), below.

Needs Ludovic: the turning fix is checked by reading the code against vanilla, not by video; a quick ride on the desktop would confirm it feels smooth.

🤖 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/1119 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/boat-water-patch` --- ### 📝 Commits (1) - [`e3cea08`](https://github.com/horizon-rust/horizon/commit/e3cea08736907a624a37c3207bc7993b7a55516c) Boats: the water patch hides water inside the hull; the riding camera turns smoothly ### 📊 Changes **5 files changed** (+118 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity.wgsl` (+5 -0) 📝 `crates/horizon-client/src/game/boats.rs` (+20 -0) 📝 `crates/horizon-client/src/game/perspective.rs` (+9 -1) 📝 `crates/horizon-client/src/gfx.rs` (+68 -12) 📝 `crates/horizon-client/src/gfx/entity_batch.rs` (+16 -7) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1016. Reported by @Doopz93: water shows inside a boat, and riding one turns the camera in steps. ## What and why 1. **Water inside the hull.** Vanilla `BoatRenderer` draws the model's `water_patch` part with `RenderTypes.waterMask()` (depth only, no colour) unless the boat is under water, before translucent terrain, so the water surface fails the depth test inside the hull. Rafts have no patch. Horizon never drew it. - New entity overlay code `WATER_MASK_OVERLAY` (13) gets its own batch bucket; `water_mask_pipeline` writes depth only (`fs_water_mask`, no colour writes) and is drawn after the entity and crumbling batches, before translucent terrain. - `boats.rs` draws `minecraft:boat#water_patch` with the hull's transform when the boat isn't a raft and isn't under (flowing) water. 2. **Choppy turning.** `AbstractBoat.positionRider` adds the boat's `deltaRotation` to the rider's `yRot` only, so `yRotO` lags by that turn and `getViewYRot` interpolates across it every frame. Horizon's camera used the current yaw as `yRotO`, so the view snapped once per tick. `camera_view` now sets `y_rot_o = yaw - delta_rotation` while riding a boat. ## Screenshots (oak boat on still water, same camera) | main | this PR | |---|---| | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/1016-main.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/1016-fix.png) | ## Self-check (all five B2 branches merged onto one integration commit, Mac mini) - On the branches rebased onto origin/main 252f877f: - `cargo fmt --all -- --check`: clean - `set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings`: exit 0 - `cargo test -p horizon-assets -p horizon-client`: all pass (960 + 84 + smaller suites, 0 failed) - `tools/parity.py --changed origin/main` (integration over e66c35b2): 238 of 268 harnesses PASS, including block_particles, particle_providers, emitter_particles, entity_particles, item_particles, marker_particles, entity_model, item_model, environment_render, section_mesh, translucency, block_entity_render, cloud_render, weather_render, world_border_render, sprite_animation, living_fluid. 1 FAIL: dedicated_server, which also fails on plain origin/main (`--fresh`, same machine; its server-timing lines differ from run to run under load). 29 non-rendering harnesses (server, sound, UI screens) were not reached locally before the run's time limit; CI runs them. - Screenshot comparison: main vs this branch from the same world, camera and commands (`--offscreen` + `horizon-ctl screenshot`), below. Needs Ludovic: the turning fix is checked by reading the code against vanilla, not by video; a quick ride on the desktop would confirm it feels smooth. 🤖 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:01:13 +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#3065
No description provided.