[PR #3444] [MERGED] Fog option off clears the Nether's fog too #4983

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

📋 Pull Request Information

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

Base: main ← Head: fix-3408


📝 Commits (2)

  • a5ae075 Fog option off clears the Nether's fog too
  • 31cfdb4 Merge remote-tracking branch 'origin/main' into fix-3408

📊 Changes

3 files changed (+102 additions, -49 deletions)

View changed files

📝 crates/horizon-client-render/src/fog.rs (+66 -0)
📝 crates/horizon-client/src/game.rs (+1 -15)
📝 crates/horizon-client/src/game/render_tick.rs (+35 -34)

📄 Description

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

What and why

Fixes #3408

With Horizon's Fog option off (Video Settings → Horizon Graphics → Advanced, fog:false in horizon-graphics.txt), the Nether stayed as foggy as with it on.

The option cleared the distance fog only when the frame's environmental fog ended at or beyond the render distance (fog.environmental_end >= streaming.radius * 16, the line the reporter pointed at). That check was there to keep lava and powder snow fog, which end 1 and 2 blocks away. But the Nether's own fog (visual/fog_end_distance 96, fog_start_distance 10 in dimension_type/the_nether.json) also ends before any render distance over 6 chunks, so it was kept as well.

Vanilla has no fog option, so this follows what Horizon's option says it does: "Distance fog. Off shows the edge of the loaded world." and, in docs/graphics.md, "fluid, darkness and boss fog retain their limits". The check now asks what kind of fog the camera is in instead of how far it reaches. Fog Off clears the distance fog whenever the fog is atmospheric (FogType::Atmospheric: no water, lava or powder snow at the camera) and no blindness, darkness or boss world fog applies. That covers every dimension and biome (the Nether biomes' fog colours stay; only the distance goes). Fog On is unchanged.

The option now lives in fog::clear_distance_fog, called from Game::frame_fog, so it reads the same FogInputs that setup_fog used for the frame. Water is now judged by FogType::Water (the fluid height at the camera, Camera.getFluidInCamera), not by the block at the camera.

Vanilla reference

Horizon-only: vanilla 26.3 has no fog option (javap -p net.minecraft.client.Options has no fog field). The fog it keeps is vanilla's: FogRenderer.setupFog with LavaFogEnvironment, PowderedSnowFogEnvironment, WaterFogEnvironment, BlindnessFogEnvironment, DarknessFogEnvironment and AtmosphericFogEnvironment's boss world fog, already ported in fog.rs. No harness covers the option. Two unit tests in fog.rs do: fog_off_clears_the_nether_fog_too fails on main and passes here, and fog_off_keeps_fluid_and_effect_fog checks that lava, powder snow, water, blindness, darkness and boss fog are left alone.

Self-check

Run on Windows 11. tools/pr_ready.py was not run; these are the steps it runs:

cargo fmt --all -- --check                                                    ok
cargo clippy -p horizon-client --features mods --all-targets -- -D warnings   ok
cargo test -p horizon-client --lib fog::                                      10 passed (fog_off_clears_the_nether_fog_too fails on origin/main)
cargo test -p horizon-client --lib                                            1113 passed, 1 failed: save::tests::session_lock_is_exclusive (fails on Windows on main too)
cargo test -p horizon-client --bins                                           156 passed

Screenshots

The same soul sand valley spot in the Nether (0.5 50 0.5, yaw 45, render distance 12) with Fog: Off.

Before (origin/main): the fog still closes in.
fog 3408 before

After: the cavern and the ceiling are visible.
fog 3408 after

Rebased on main after #3186

Rebased on main after #3186 (62a01db8f). fog.rs moved to crates/horizon-client-render/src/fog.rs, so fog::clear_distance_fog and the two new tests are there now. Game::frame_fog (game/render_tick.rs) still calls it as horizon_client::fog::clear_distance_fog, through horizon-client's re-export.

Self-check after the rebase

Run on Windows 11. tools/pr_ready.py was not run; these are the steps it runs:

cargo fmt --all -- --check                                                    ok
cargo clippy -p horizon-client-render --all-targets -- -D warnings            ok
cargo clippy -p horizon-client --features mods --all-targets -- -D warnings   ok
cargo test -p horizon-client-render --lib fog::                               10 passed (fog_off_clears_the_nether_fog_too fails on origin/main)
cargo test -p horizon-client --features mods --bins                           141 + 18 passed, 3 ignored

🤖 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/3444 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-3408` --- ### 📝 Commits (2) - [`a5ae075`](https://github.com/horizon-rust/horizon/commit/a5ae075a5d585264bfe234f8c7f148d4aef67749) Fog option off clears the Nether's fog too - [`31cfdb4`](https://github.com/horizon-rust/horizon/commit/31cfdb4b95583b9bcaaad698f4c75ae95c33b17b) Merge remote-tracking branch 'origin/main' into fix-3408 ### 📊 Changes **3 files changed** (+102 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/fog.rs` (+66 -0) 📝 `crates/horizon-client/src/game.rs` (+1 -15) 📝 `crates/horizon-client/src/game/render_tick.rs` (+35 -34) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Fixes #3408 With Horizon's **Fog** option off (Video Settings → Horizon Graphics → Advanced, `fog:false` in `horizon-graphics.txt`), the Nether stayed as foggy as with it on. The option cleared the distance fog only when the frame's environmental fog ended at or beyond the render distance (`fog.environmental_end >= streaming.radius * 16`, the line the reporter pointed at). That check was there to keep lava and powder snow fog, which end 1 and 2 blocks away. But the Nether's own fog (`visual/fog_end_distance` 96, `fog_start_distance` 10 in `dimension_type/the_nether.json`) also ends before any render distance over 6 chunks, so it was kept as well. Vanilla has no fog option, so this follows what Horizon's option says it does: "Distance fog. Off shows the edge of the loaded world." and, in `docs/graphics.md`, "fluid, darkness and boss fog retain their limits". The check now asks what kind of fog the camera is in instead of how far it reaches. Fog Off clears the distance fog whenever the fog is atmospheric (`FogType::Atmospheric`: no water, lava or powder snow at the camera) and no blindness, darkness or boss world fog applies. That covers every dimension and biome (the Nether biomes' fog colours stay; only the distance goes). Fog On is unchanged. The option now lives in `fog::clear_distance_fog`, called from `Game::frame_fog`, so it reads the same `FogInputs` that `setup_fog` used for the frame. Water is now judged by `FogType::Water` (the fluid height at the camera, `Camera.getFluidInCamera`), not by the block at the camera. ## Vanilla reference Horizon-only: vanilla 26.3 has no fog option (`javap -p net.minecraft.client.Options` has no fog field). The fog it keeps is vanilla's: `FogRenderer.setupFog` with `LavaFogEnvironment`, `PowderedSnowFogEnvironment`, `WaterFogEnvironment`, `BlindnessFogEnvironment`, `DarknessFogEnvironment` and `AtmosphericFogEnvironment`'s boss world fog, already ported in `fog.rs`. No harness covers the option. Two unit tests in `fog.rs` do: `fog_off_clears_the_nether_fog_too` fails on main and passes here, and `fog_off_keeps_fluid_and_effect_fog` checks that lava, powder snow, water, blindness, darkness and boss fog are left alone. ## Self-check Run on Windows 11. `tools/pr_ready.py` was not run; these are the steps it runs: ``` cargo fmt --all -- --check ok cargo clippy -p horizon-client --features mods --all-targets -- -D warnings ok cargo test -p horizon-client --lib fog:: 10 passed (fog_off_clears_the_nether_fog_too fails on origin/main) cargo test -p horizon-client --lib 1113 passed, 1 failed: save::tests::session_lock_is_exclusive (fails on Windows on main too) cargo test -p horizon-client --bins 156 passed ``` ## Screenshots The same soul sand valley spot in the Nether (0.5 50 0.5, yaw 45, render distance 12) with Fog: Off. Before (origin/main): the fog still closes in. ![fog 3408 before](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/fog-3408-before.png) After: the cavern and the ceiling are visible. ![fog 3408 after](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/fog-3408-after.png) ## Rebased on main after #3186 Rebased on main after #3186 (62a01db8f). `fog.rs` moved to `crates/horizon-client-render/src/fog.rs`, so `fog::clear_distance_fog` and the two new tests are there now. `Game::frame_fog` (`game/render_tick.rs`) still calls it as `horizon_client::fog::clear_distance_fog`, through horizon-client's re-export. ### Self-check after the rebase Run on Windows 11. `tools/pr_ready.py` was not run; these are the steps it runs: ``` cargo fmt --all -- --check ok cargo clippy -p horizon-client-render --all-targets -- -D warnings ok cargo clippy -p horizon-client --features mods --all-targets -- -D warnings ok cargo test -p horizon-client-render --lib fog:: 10 passed (fog_off_clears_the_nether_fog_too fails on origin/main) cargo test -p horizon-client --features mods --bins 141 + 18 passed, 3 ignored ``` 🤖 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:09:21 +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#4983
No description provided.