[PR #4029] [MERGED] No rain splashes or rain sound under a high roof #5366

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4029
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix-3810


📝 Commits (1)

  • 58cdd75 No rain splashes or rain sound under a high roof

📊 Changes

2 files changed (+71 additions, -19 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -5)
📝 crates/horizon-client/src/game/render_tick.rs (+70 -14)

📄 Description

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

What and why

Rain splashes (blue rain particles) and the rain sound showed up on the floor of a deep excavation, even with solid stone overhead.

Cause: tick_particles (render_tick.rs) found the rain height with its own scan that started 64 blocks above the camera, not at the top of the world. When the roof was more than about 64 blocks above the player and the air below it reached that high, the scan began in the air under the roof and found the excavation floor as the "top". The floor was within the ±10 block window, so it got splashes and the rain sound. The same scan backed the animate tick's isRainingAt.

Vanilla reads the MOTION_BLOCKING heightmap. The client already keeps that heightmap per chunk (World::motion_blocking, kept current on block writes), and Game::rain_height already uses it for the rain columns. With this fix, the splash columns, the roof check for weather.rain.above and the animate tick's raining_at all use it too, through one motion_blocking_height helper that rain_height now shares. This replaces a column scan for each splash with a cached lookup.

Fixes #3810

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

  • ClientLevel.tickWeatherEffects() (javap, 26.3 client.jar): for each splash it calls getHeightmapPos(Heightmap$Types.MOTION_BLOCKING, cameraPos.offset(dx, 0, dz)), then skips the column when the height is <= getMinY() or more than 10 blocks above or below the camera. The rain sound uses getHeightmapPos(MOTION_BLOCKING, cameraPos).getY() > Mth.floor(cameraY) to pick WEATHER_RAIN_ABOVE.
  • Level.isRainingAt: getHeightmapPos(MOTION_BLOCKING, pos).getY() <= pos.getY().
  • Test: game::render_tick::tests::no_rain_splash_under_a_high_roof puts a stone roof 70, 80 and 200 blocks above the camera (no splash), then removes it (a splash on the floor) and adds a roof 8 blocks up (the splash lands on the roof). No parity harness covers tickWeatherEffects. tools/test_weather_render_parity.py checks the rain column quads, which already used the heightmap.

Self-check

tools/pr_ready.py doesn't run on Windows, so I ran these by hand:

  • cargo fmt --all -- --check: clean
  • cargo clippy -p horizon-client --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --bin horizon-client -- render_tick:
    • with the fix: 1 passed
    • with splash_height swapped back to the old scan from 64 blocks above the camera: FAILED ... assertion left == right failed: roof at 70; left: Some(1), right: None
  • cargo test -p horizon-client --bin horizon-client -- rain weather: 1 passed
  • In game (cargo build --profile fast, single player with the server on a thread, plus a LAN guest). Setup: a 19x19 room hollowed out from y -50 to 30 under natural terrain, a stone cap at 31-33, the player on the floor at y -50 while it rains.
    • main: the rain particle count went up about 1,700 a second, and blue splashes covered the floor.
    • this branch: 0 rain particles in 10 s on the floor, for the host and for a LAN guest.
    • On the surface, rain still splashes normally (about 2,000 a second).
    • Opening a 3x3 shaft from the room to the sky brings splashes back under the shaft only, so the heightmap follows block changes.

Screenshots

before: deep underground under a roof, rain splashes land on the cave floor

after: no rain underground

Before: in the covered excavation (night vision on), the stone floor is dotted with blue rain splashes. After: the same view has a clean floor and no splashes, while the surface above still shows rain and splashes.

🤖 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/4029 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-3810` --- ### 📝 Commits (1) - [`58cdd75`](https://github.com/horizon-rust/horizon/commit/58cdd754cddeb488b065ede60cea9ca6820add22) No rain splashes or rain sound under a high roof ### 📊 Changes **2 files changed** (+71 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -5) 📝 `crates/horizon-client/src/game/render_tick.rs` (+70 -14) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando personally. ## What and why Rain splashes (blue rain particles) and the rain sound showed up on the floor of a deep excavation, even with solid stone overhead. Cause: `tick_particles` (render_tick.rs) found the rain height with its own scan that started **64 blocks above the camera**, not at the top of the world. When the roof was more than about 64 blocks above the player and the air below it reached that high, the scan began in the air under the roof and found the excavation floor as the "top". The floor was within the ±10 block window, so it got splashes and the rain sound. The same scan backed the animate tick's `isRainingAt`. Vanilla reads the MOTION_BLOCKING heightmap. The client already keeps that heightmap per chunk (`World::motion_blocking`, kept current on block writes), and `Game::rain_height` already uses it for the rain columns. With this fix, the splash columns, the roof check for `weather.rain.above` and the animate tick's `raining_at` all use it too, through one `motion_blocking_height` helper that `rain_height` now shares. This replaces a column scan for each splash with a cached lookup. Fixes #3810 ## Kind - [x] 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 - `ClientLevel.tickWeatherEffects()` (javap, 26.3 client.jar): for each splash it calls `getHeightmapPos(Heightmap$Types.MOTION_BLOCKING, cameraPos.offset(dx, 0, dz))`, then skips the column when the height is `<= getMinY()` or more than 10 blocks above or below the camera. The rain sound uses `getHeightmapPos(MOTION_BLOCKING, cameraPos).getY() > Mth.floor(cameraY)` to pick `WEATHER_RAIN_ABOVE`. - `Level.isRainingAt`: `getHeightmapPos(MOTION_BLOCKING, pos).getY() <= pos.getY()`. - Test: `game::render_tick::tests::no_rain_splash_under_a_high_roof` puts a stone roof 70, 80 and 200 blocks above the camera (no splash), then removes it (a splash on the floor) and adds a roof 8 blocks up (the splash lands on the roof). No parity harness covers `tickWeatherEffects`. `tools/test_weather_render_parity.py` checks the rain column quads, which already used the heightmap. ## Self-check `tools/pr_ready.py` doesn't run on Windows, so I ran these by hand: - `cargo fmt --all -- --check`: clean - `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --bin horizon-client -- render_tick`: - with the fix: `1 passed` - with `splash_height` swapped back to the old scan from 64 blocks above the camera: `FAILED ... assertion left == right failed: roof at 70; left: Some(1), right: None` - `cargo test -p horizon-client --bin horizon-client -- rain weather`: 1 passed - In game (`cargo build --profile fast`, single player with the server on a thread, plus a LAN guest). Setup: a 19x19 room hollowed out from y -50 to 30 under natural terrain, a stone cap at 31-33, the player on the floor at y -50 while it rains. - main: the `rain` particle count went up about 1,700 a second, and blue splashes covered the floor. - this branch: 0 rain particles in 10 s on the floor, for the host and for a LAN guest. - On the surface, rain still splashes normally (about 2,000 a second). - Opening a 3x3 shaft from the room to the sky brings splashes back under the shaft only, so the heightmap follows block changes. ## Screenshots ![before: deep underground under a roof, rain splashes land on the cave floor](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/3810-1.png) ![after: no rain underground](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/3810-2.png) Before: in the covered excavation (night vision on), the stone floor is dotted with blue rain splashes. After: the same view has a clean floor and no splashes, while the surface above still shows rain and splashes. 🤖 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:12:05 +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#5366
No description provided.