[PR #2262] [MERGED] Flat worlds: no black horizon, the dark disc and void fog use the flat horizon #4155

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2262
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/2209-flat-world-horizon


📝 Commits (4)

  • 94592a3 Use the flat world's horizon height for the dark disc and void fog
  • e872d3a Send isFlat in every dimension and use the dimension's min y for the horizon
  • 905fd0d Merge origin/main into fix/2209-flat-world-horizon
  • 3093f8c Merge origin/main into fix/2209-flat-world-horizon (picks up main's rabbit-arm fix, #2716)

📊 Changes

5 files changed (+41 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -0)
📝 crates/horizon-client/src/game/lan.rs (+2 -1)
📝 crates/horizon-client/src/game/remote.rs (+5 -1)
📝 crates/horizon-client/src/game/render_tick.rs (+25 -5)
📝 crates/horizon-client/src/lan/hub.rs (+5 -1)

📄 Description

What and why

In a superflat world the horizon turned black and the black spread up into the sky, more so at lower
render distances.

Horizon always used vanilla's normal-world values: the dark disc under the sky was drawn whenever the
camera was below y 63, and the void fog darkness used a 32-block range. A superflat player stands at
about y -60, so the dark disc was always drawn and the fog was darkened by almost 90%; a shorter render
distance brings that dark fog closer, so the black grew.

Vanilla uses the bottom of the world as the horizon height of a flat level and a 1-block void darkness
range. The fog code already had the flat case but was always given flat: false, and the server never
told the client the level was flat. Now:

  • the world's overworld flat preset is read when the world loads (WorldGen.flat);
  • the server sends it in CommonPlayerSpawnInfo.isFlat for the overworld (it was always false);
  • the client keeps the flag from Login/Respawn, and the dark disc and the fog use it.

Fixes #2209.

Vanilla reference

  • ClientLevel.ClientLevelData.getHorizonHeight: isFlat ? level.getMinY() : 63.0.
  • ClientLevel.ClientLevelData.voidDarknessOnsetRange: isFlat ? 1.0F : 32.0F.
  • SkyRenderer.shouldRenderDarkDisc: eye y minus the horizon height below 0.
  • FogRenderer: void darkness from voidDarknessOnsetRange.
  • PlayerList.placeNewPlayer / ServerPlayer.createCommonSpawnInfo: isFlat is ServerLevel.isFlat().

Self-check

cargo check -p horizon-client passes.


🔄 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/2262 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2209-flat-world-horizon` --- ### 📝 Commits (4) - [`94592a3`](https://github.com/horizon-rust/horizon/commit/94592a35ac5922d6f79b5ad53e1a3f71034d4c2e) Use the flat world's horizon height for the dark disc and void fog - [`e872d3a`](https://github.com/horizon-rust/horizon/commit/e872d3ae54795ab03e9eade7c4230a3783e88d6c) Send isFlat in every dimension and use the dimension's min y for the horizon - [`905fd0d`](https://github.com/horizon-rust/horizon/commit/905fd0d193a19b63e1b055ff070907f46c733d43) Merge origin/main into fix/2209-flat-world-horizon - [`3093f8c`](https://github.com/horizon-rust/horizon/commit/3093f8c59454c2522bf34eee8ae7133c1337b055) Merge origin/main into fix/2209-flat-world-horizon (picks up main's rabbit-arm fix, #2716) ### 📊 Changes **5 files changed** (+41 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+5 -1) 📝 `crates/horizon-client/src/game/render_tick.rs` (+25 -5) 📝 `crates/horizon-client/src/lan/hub.rs` (+5 -1) </details> ### 📄 Description ## What and why In a superflat world the horizon turned black and the black spread up into the sky, more so at lower render distances. Horizon always used vanilla's normal-world values: the dark disc under the sky was drawn whenever the camera was below y 63, and the void fog darkness used a 32-block range. A superflat player stands at about y -60, so the dark disc was always drawn and the fog was darkened by almost 90%; a shorter render distance brings that dark fog closer, so the black grew. Vanilla uses the bottom of the world as the horizon height of a flat level and a 1-block void darkness range. The fog code already had the flat case but was always given `flat: false`, and the server never told the client the level was flat. Now: - the world's overworld flat preset is read when the world loads (`WorldGen.flat`); - the server sends it in `CommonPlayerSpawnInfo.isFlat` for the overworld (it was always `false`); - the client keeps the flag from Login/Respawn, and the dark disc and the fog use it. Fixes #2209. ## Vanilla reference - `ClientLevel.ClientLevelData.getHorizonHeight`: `isFlat ? level.getMinY() : 63.0`. - `ClientLevel.ClientLevelData.voidDarknessOnsetRange`: `isFlat ? 1.0F : 32.0F`. - `SkyRenderer.shouldRenderDarkDisc`: eye y minus the horizon height below 0. - `FogRenderer`: void darkness from `voidDarknessOnsetRange`. - `PlayerList.placeNewPlayer` / `ServerPlayer.createCommonSpawnInfo`: `isFlat` is `ServerLevel.isFlat()`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15: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#4155
No description provided.