[PR #1118] [MERGED] Sky, fog and water fog colours blend across biomes (GaussianSampler) #3064

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/1118
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: fix/biome-fog-blend


📝 Commits (1)

  • 7404c2b Sky, fog and water fog colours blend across biomes (GaussianSampler)

📊 Changes

5 files changed (+150 additions, -28 deletions)

View changed files

📝 crates/horizon-client/examples/environment_fixture.rs (+5 -1)
📝 crates/horizon-client/src/biome.rs (+99 -0)
📝 crates/horizon-client/src/environment.rs (+14 -10)
📝 crates/horizon-client/src/game.rs (+30 -11)
📝 crates/horizon-client/src/game/render_tick.rs (+2 -6)

📄 Description

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

Fixes #797. Reported by @LookImEcho-Rick: the Nether fog colour holds, then switches abruptly at a biome boundary.

What and why

Vanilla reads positional environment attributes (fog colour, sky colour, water fog colour) through EnvironmentAttributeProbe: a GaussianSampler over 6x6x6 quart cells around pos * 0.25 - 0.5 with the kernel [0, 1, 4, 6, 4, 1, 0], and SpatialAttributeInterpolator, which lerps the biome values in order with ARGB.srgbLerp. Unloaded chunks count as plains. Horizon used the camera's biome only.

  • biome::gaussian_weights / blend_rgb: the sampler and the ordered sRGB lerp.
  • The frame computes the weights once at the camera and blends the sky, fog and water fog colours with them; frame_fog takes the blended water fog.

Screenshots: Nether, soul_sand_valley (x < 0) next to crimson_forest (x >= 0)

Fog colour above the roof, mean of a 80x100 px patch, camera at y 145:

x main this PR
-12 [27.0, 63.5, 61.6] [28.0, 61.6, 60.7]
-8 [27.0, 63.5, 61.6] [28.0, 60.7, 58.7]
-6 [27.0, 63.5, 61.6] [29.0, 58.7, 56.8]
-4 [27.1, 63.5, 61.6] [30.9, 52.0, 50.1]
-3 [27.0, 63.5, 61.5] [32.8, 48.2, 47.2]
-2 [27.0, 63.5, 61.6] [33.7, 45.3, 43.3]
-1 [27.1, 63.5, 61.6] [35.7, 39.5, 38.5]
0 [47.2, 7.8, 7.8] [37.6, 34.7, 33.7]
1 [47.2, 7.8, 7.8] [38.5, 29.9, 28.9]
2 [47.3, 7.8, 7.8] [40.5, 24.1, 24.1]
3 [47.2, 7.8, 7.8] [42.5, 21.2, 20.3]
4 [47.2, 7.8, 7.8] [43.4, 17.4, 17.4]
6 [47.2, 7.8, 7.8] [45.3, 10.6, 10.6]
8 [47.2, 7.8, 7.8] [46.3, 8.7, 8.7]
12 [47.2, 7.8, 7.8] [47.2, 7.8, 7.8]
x main this PR
-4
0
4

Tests

New biome::blend_tests: a single biome gives its colour unchanged; a half/half split blends in the sampler's order.

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: nothing.

🤖 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/1118 **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/biome-fog-blend` --- ### 📝 Commits (1) - [`7404c2b`](https://github.com/horizon-rust/horizon/commit/7404c2b94eb88c1b64e76f4a31a8abf1efc42ef3) Sky, fog and water fog colours blend across biomes (GaussianSampler) ### 📊 Changes **5 files changed** (+150 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/environment_fixture.rs` (+5 -1) 📝 `crates/horizon-client/src/biome.rs` (+99 -0) 📝 `crates/horizon-client/src/environment.rs` (+14 -10) 📝 `crates/horizon-client/src/game.rs` (+30 -11) 📝 `crates/horizon-client/src/game/render_tick.rs` (+2 -6) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #797. Reported by @LookImEcho-Rick: the Nether fog colour holds, then switches abruptly at a biome boundary. ## What and why Vanilla reads positional environment attributes (fog colour, sky colour, water fog colour) through `EnvironmentAttributeProbe`: a `GaussianSampler` over 6x6x6 quart cells around `pos * 0.25 - 0.5` with the kernel `[0, 1, 4, 6, 4, 1, 0]`, and `SpatialAttributeInterpolator`, which lerps the biome values in order with `ARGB.srgbLerp`. Unloaded chunks count as plains. Horizon used the camera's biome only. - `biome::gaussian_weights` / `blend_rgb`: the sampler and the ordered sRGB lerp. - The frame computes the weights once at the camera and blends the sky, fog and water fog colours with them; `frame_fog` takes the blended water fog. ## Screenshots: Nether, soul_sand_valley (x < 0) next to crimson_forest (x >= 0) Fog colour above the roof, mean of a 80x100 px patch, camera at y 145: | x | main | this PR | |---|---|---| | -12 | [27.0, 63.5, 61.6] | [28.0, 61.6, 60.7] | | -8 | [27.0, 63.5, 61.6] | [28.0, 60.7, 58.7] | | -6 | [27.0, 63.5, 61.6] | [29.0, 58.7, 56.8] | | -4 | [27.1, 63.5, 61.6] | [30.9, 52.0, 50.1] | | -3 | [27.0, 63.5, 61.5] | [32.8, 48.2, 47.2] | | -2 | [27.0, 63.5, 61.6] | [33.7, 45.3, 43.3] | | -1 | [27.1, 63.5, 61.6] | [35.7, 39.5, 38.5] | | 0 | [47.2, 7.8, 7.8] | [37.6, 34.7, 33.7] | | 1 | [47.2, 7.8, 7.8] | [38.5, 29.9, 28.9] | | 2 | [47.3, 7.8, 7.8] | [40.5, 24.1, 24.1] | | 3 | [47.2, 7.8, 7.8] | [42.5, 21.2, 20.3] | | 4 | [47.2, 7.8, 7.8] | [43.4, 17.4, 17.4] | | 6 | [47.2, 7.8, 7.8] | [45.3, 10.6, 10.6] | | 8 | [47.2, 7.8, 7.8] | [46.3, 8.7, 8.7] | | 12 | [47.2, 7.8, 7.8] | [47.2, 7.8, 7.8] | | x | main | this PR | |---|---|---| | -4 | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/797-main-x-4.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/797-fix-x-4.png) | | 0 | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/797-main-x0.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/797-fix-x0.png) | | 4 | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/797-main-x4.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/797-fix-x4.png) | ## Tests New `biome::blend_tests`: a single biome gives its colour unchanged; a half/half split blends in the sampler's order. ## 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: nothing. 🤖 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#3064
No description provided.