[PR #6003] [MERGED] feat(mods): final world fog parameters hook #6603

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

📋 Pull Request Information

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

Base: main ← Head: native/render-fog


📝 Commits (2)

  • e0c64b5 feat(mods): adjust final world fog parameters
  • 2b87858 Merge upstream/main into native/render-fog

📊 Changes

4 files changed (+120 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+12 -0)
📝 crates/horizon-client/src/game/render_tick.rs (+33 -0)
➕ tests/test_render_fog_hook.py (+63 -0)
➕ tools/native-hook-fragments/render_fog.json (+12 -0)

📄 Description

🤖 Opened by Xmilon's AI agent (Codex), not by Xmilon personally.

What and why

Fixes #6002; part of #4953. native_render_fog(partial, camera, fog_type, fog) exposes final world FogData after environment/effect/render-distance calculations and Horizon's fog option, before GPU upload. Title panoramas skip the hook. Mods can change color and environmental/render/sky/cloud distances.

Accept only finite RGBA components in 0..=1 and finite distance values, with environmental and render-distance ends greater than their starts and nonnegative sky/cloud ends. Negative near planes remain supported for water/lava. Invalid requests retain the original whole fog value, so a partially invalid change cannot leak into upload.

Kind

  • feature: something new for players

Vanilla reference

Read the player's pinned 26.3 FogRenderer.setupFog/updateBuffer bytecode. Public contract: ViewportEvent.RenderFog, including mutable FogData. No game files included.

Other projects' code

None; public event documentation only.

Self-check

Client Clippy --all-targets -D warnings passed. The actual dispatch helper compiled/executed with a fake mod: unchanged data, valid distance/color overrides, negative near planes, zero sky end, NaN/infinity, reversed/equal planes and invalid color all covered; invalid requests fall back atomically. Four fragment-tool tests, formatting, diff/public-tree checks passed. API fragment only. No game launch/screenshots or full game test suite; CI pending.

🤖 Generated with Codex


🔄 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/6003 **Author:** [@Xmilon](https://github.com/Xmilon) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `native/render-fog` --- ### 📝 Commits (2) - [`e0c64b5`](https://github.com/horizon-rust/horizon/commit/e0c64b5cc8d1fcf88c62ff658315ef81229e5194) feat(mods): adjust final world fog parameters - [`2b87858`](https://github.com/horizon-rust/horizon/commit/2b878588bdd48b51ce6f677ec17797571d3b9663) Merge upstream/main into native/render-fog ### 📊 Changes **4 files changed** (+120 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+12 -0) 📝 `crates/horizon-client/src/game/render_tick.rs` (+33 -0) ➕ `tests/test_render_fog_hook.py` (+63 -0) ➕ `tools/native-hook-fragments/render_fog.json` (+12 -0) </details> ### 📄 Description > 🤖 Opened by Xmilon's AI agent (Codex), not by Xmilon personally. ## What and why Fixes #6002; part of #4953. `native_render_fog(partial, camera, fog_type, fog)` exposes final world FogData after environment/effect/render-distance calculations and Horizon's fog option, before GPU upload. Title panoramas skip the hook. Mods can change color and environmental/render/sky/cloud distances. Accept only finite RGBA components in 0..=1 and finite distance values, with environmental and render-distance ends greater than their starts and nonnegative sky/cloud ends. Negative near planes remain supported for water/lava. Invalid requests retain the original whole fog value, so a partially invalid change cannot leak into upload. ## Kind - [x] feature: something new for players ## Vanilla reference Read the player's pinned 26.3 FogRenderer.setupFog/updateBuffer bytecode. Public contract: [ViewportEvent.RenderFog](https://aldak0.ru/javadoc/26.3.x/net/neoforged/neoforge/client/event/ViewportEvent.RenderFog.html), including mutable FogData. No game files included. ## Other projects' code None; public event documentation only. ## Self-check Client Clippy --all-targets -D warnings passed. The actual dispatch helper compiled/executed with a fake mod: unchanged data, valid distance/color overrides, negative near planes, zero sky end, NaN/infinity, reversed/equal planes and invalid color all covered; invalid requests fall back atomically. Four fragment-tool tests, formatting, diff/public-tree checks passed. API fragment only. No game launch/screenshots or full game test suite; CI pending. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:41 +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#6603
No description provided.