[PR #6321] [MERGED] camera fluid: lava fog starts when a corner of the near plane dips under the lava #6793

Closed
opened 2026-11-03 06:26:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6321
Author: @iLostName
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: flowing-lava-camera-inside


📝 Commits (1)

  • 30715a9 camera fluid: lava fog starts when a corner of the near plane dips under the lava

📊 Changes

6 files changed (+105 additions, -27 deletions)

View changed files

📝 crates/horizon-client-render/src/camera.rs (+38 -0)
📝 crates/horizon-client-render/src/fog.rs (+42 -18)
📝 crates/horizon-client/src/game.rs (+1 -1)
📝 crates/horizon-client/src/game/fov.rs (+1 -1)
📝 crates/horizon-client/src/game/render_tick.rs (+17 -4)
📝 crates/horizon-client/src/game/sculk.rs (+6 -3)

📄 Description

What and why

With the camera right at a lava surface (flowing lava especially), Horizon looked for lava only at the eye and 0.05 ahead of it. When just a corner of the near plane was under the surface no lava fog came on, and you saw into the lava: past its culled inner faces to the ground below. Fog type, the FOV narrowing and the sky check now test the near plane's centre and four corners, so any corner under the surface brings the lava fog on, as in vanilla.

  • camera.rs: Camera::near_plane, vanilla's getNearPlane (zNear 0.05, the window's aspect).
  • fog.rs: fog_type checks lava and powder snow at its 5 points; water still at the camera's block.
  • render_tick.rs: Game::near_plane() at the FOV option and window size; callers updated.

Tested in game (offscreen, server thread): flowing lava at level 4 on trapdoors, the player crouched on one with the eye 0.013 above the surface, looking level: lava fog now; standing (0.36 above) the sky shows as before.

Fixes #5833.

Vanilla reference

Camera.getFluidInCamera: water at the camera's block, then lava and powder snow at getNearPlane(fov)'s forward, getTopLeft, getTopRight, getBottomLeft and getBottomRight, each compared with FluidState.getHeightForCamera.

Self-check

pr_ready (tools/pr_ready.py --quick on PC-Lost, against origin/main at 1bd24e404, 4 min 46 s)

Check Result
Scope ✅ 6 files, +105 −27
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 586 run, FAILED (errors=1, skipped=2) (2 min 0 s)
rustfmt ✅ (14 s)
clippy ✅ (47 s)
tests: horizon-client, horizon-client-render ❌ 1749 passed, 1 failed (1 min 38 s)
doc tests ✅ 0 passed (4 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)

Rebased on e5a4324ca afterwards: clippy and the touched crates' fog, dragon and render tests rerun green. The two failures are Windows-only and outside this branch: native_hooks::tests::native_loot_kinds_stay_hookable looks for "\n}\n" in a CRLF checkout, and test_world_input_capture exits 101 here. Parity is left to CI.


🔄 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/6321 **Author:** [@iLostName](https://github.com/iLostName) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `flowing-lava-camera-inside` --- ### 📝 Commits (1) - [`30715a9`](https://github.com/horizon-rust/horizon/commit/30715a97d991b0a7b87c761fb22ab87435a0bc9d) camera fluid: lava fog starts when a corner of the near plane dips under the lava ### 📊 Changes **6 files changed** (+105 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/camera.rs` (+38 -0) 📝 `crates/horizon-client-render/src/fog.rs` (+42 -18) 📝 `crates/horizon-client/src/game.rs` (+1 -1) 📝 `crates/horizon-client/src/game/fov.rs` (+1 -1) 📝 `crates/horizon-client/src/game/render_tick.rs` (+17 -4) 📝 `crates/horizon-client/src/game/sculk.rs` (+6 -3) </details> ### 📄 Description ## What and why With the camera right at a lava surface (flowing lava especially), Horizon looked for lava only at the eye and 0.05 ahead of it. When just a corner of the near plane was under the surface no lava fog came on, and you saw into the lava: past its culled inner faces to the ground below. Fog type, the FOV narrowing and the sky check now test the near plane's centre and four corners, so any corner under the surface brings the lava fog on, as in vanilla. - `camera.rs`: `Camera::near_plane`, vanilla's `getNearPlane` (zNear 0.05, the window's aspect). - `fog.rs`: `fog_type` checks lava and powder snow at its 5 points; water still at the camera's block. - `render_tick.rs`: `Game::near_plane()` at the FOV option and window size; callers updated. Tested in game (offscreen, server thread): flowing lava at level 4 on trapdoors, the player crouched on one with the eye 0.013 above the surface, looking level: lava fog now; standing (0.36 above) the sky shows as before. Fixes #5833. ## Vanilla reference `Camera.getFluidInCamera`: water at the camera's block, then lava and powder snow at `getNearPlane(fov)`'s `forward`, `getTopLeft`, `getTopRight`, `getBottomLeft` and `getBottomRight`, each compared with `FluidState.getHeightForCamera`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on PC-Lost, against origin/main at 1bd24e404, 4 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +105 −27 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 586 run, FAILED (errors=1, skipped=2) (2 min 0 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (47 s) | | tests: horizon-client, horizon-client-render | ❌ 1749 passed, 1 failed (1 min 38 s) | | doc tests | ✅ 0 passed (4 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) | Rebased on e5a4324ca afterwards: clippy and the touched crates' fog, dragon and render tests rerun green. The two failures are Windows-only and outside this branch: `native_hooks::tests::native_loot_kinds_stay_hookable` looks for `"\n}\n"` in a CRLF checkout, and `test_world_input_capture` exits 101 here. Parity is left to CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:46 +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#6793
No description provided.