[PR #1655] [MERGED] Shader packs, clean room 9: frame uniforms, and gl_FragCoord in buffer passes #3664

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1655
Author: @ludovic111
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: feat/shader-packs-uniforms


📝 Commits (1)

  • 303d497 Shader packs, clean room 9: frame uniforms, and gl_FragCoord in buffer passes

📊 Changes

6 files changed (+409 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+8 -0)
📝 crates/horizon-client/src/game/fov.rs (+1 -1)
➕ crates/horizon-client/src/game/shader_packs.rs (+34 -0)
📝 crates/horizon-client/src/gfx.rs (+3 -0)
➕ crates/horizon-client/src/gfx/pack_uniforms.rs (+329 -0)
📝 crates/horizon-shaders/src/translate/mod.rs (+34 -2)

📄 Description

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

Shader packs, clean room 9 (slice 5c): frame uniforms, and a translator fix. Stacked on #1654.

What

  • gfx/pack_uniforms.rs: the values a pack's post-processing programs read once per frame (§5.2, class F), in GL's conventions (§5.5): cameraPosition and the previous one, eyeAltitude, upPosition, sunPosition/moonPosition/shadowLightPosition in view space (the sky's own frame for the bodies), sunAngle, shadowAngle, worldTime, worldDay, moonPhase, frameCounter, frameTime, frameTimeCounter, viewWidth/Height, aspectRatio, near, far, rainStrength, wetness (smoothed), thunderStrength, fog colour/start/end/mode/shape/density, skyColor, isEyeInWater, blindness, nightVision, darkness, screenBrightness, hideGUI, eyeBrightness and its smoothed value, gbufferModelView/Projection, their inverses and last frame's. The projection is GL's perspective with the world's planes (0.05 and depth_far) times vanilla's view bobbing. Each value is written as the type the pack declared (an int declared float still works).
  • The game passes what only it knows (day time, weather levels, fluid and light at the camera, blindness, F1, brightness) in Frame::pack, only when HORIZON_SHADER_PACK is set.
  • Fix to #1601 (slice 4): programs drawing to buffers read gl_FragCoord through a variable only final set, so it read 0. Every target sets it now, with a test. Found by the first frame drawn with a pack.

Nothing reads the uniforms until the next PR: players see no change (skip-release).

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §5.2 (F-class rows), §5.5, §5.6, OQ-26 and OQ-36; no other loader's code read. Decisions (smoothing per frame in seconds, fog from the nearer of vanilla's two fogs) are in the clean room's impl-plan.md.

How tested

Unit tests: values written as the declared type, values past the block dropped; noon puts the sun straight up and a quarter turn later it sets in the west; gl_FragCoord set for both targets. The values themselves are checked on screen in the next PR (the test pack's depth bands use gbufferProjectionInverse, far, viewWidth).

Self-check (whole stack, on its top branch feat/shader-packs-post)

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 16d49fe66, 33 min 27 s)

Check Result
Scope ⚠️ 35 files, +5328 −13; 5068 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅ (1 s)
Python tests ➖ no Python change
rustfmt ✅ (18 s)
clippy ✅ (2 min 38 s)
tests: workspace ✅ 1965 passed (26 min 23 s)
doc tests ✅ 1 passed (4 min 7 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more
Label skip-release: players see nothing without HORIZON_SHADER_PACK

Parity: 326 harnesses selected (the root Cargo.toml, then gfx.rs and game.rs in the last PR); CI runs them. The renderer changes only act when a pack is loaded: without HORIZON_SHADER_PACK the world target, depth stores and passes are as before.

Needs Ludovic

Nothing for this PR. Label skip-release: it runs only behind HORIZON_SHADER_PACK; the first visible slice is the Shader Packs page (slice 9).

🤖 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/1655 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-uniforms` --- ### 📝 Commits (1) - [`303d497`](https://github.com/horizon-rust/horizon/commit/303d497a676cd9a2667ca0c28345f6fc1ad45ee7) Shader packs, clean room 9: frame uniforms, and gl_FragCoord in buffer passes ### 📊 Changes **6 files changed** (+409 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+8 -0) 📝 `crates/horizon-client/src/game/fov.rs` (+1 -1) ➕ `crates/horizon-client/src/game/shader_packs.rs` (+34 -0) 📝 `crates/horizon-client/src/gfx.rs` (+3 -0) ➕ `crates/horizon-client/src/gfx/pack_uniforms.rs` (+329 -0) 📝 `crates/horizon-shaders/src/translate/mod.rs` (+34 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 9 (slice 5c):** frame uniforms, and a translator fix. Stacked on #1654. ## What - `gfx/pack_uniforms.rs`: the values a pack's post-processing programs read once per frame (§5.2, class F), in GL's conventions (§5.5): `cameraPosition` and the previous one, `eyeAltitude`, `upPosition`, `sunPosition`/`moonPosition`/`shadowLightPosition` in view space (the sky's own frame for the bodies), `sunAngle`, `shadowAngle`, `worldTime`, `worldDay`, `moonPhase`, `frameCounter`, `frameTime`, `frameTimeCounter`, `viewWidth/Height`, `aspectRatio`, `near`, `far`, `rainStrength`, `wetness` (smoothed), `thunderStrength`, fog colour/start/end/mode/shape/density, `skyColor`, `isEyeInWater`, `blindness`, `nightVision`, darkness, `screenBrightness`, `hideGUI`, `eyeBrightness` and its smoothed value, `gbufferModelView`/`Projection`, their inverses and last frame's. The projection is GL's perspective with the world's planes (0.05 and `depth_far`) times vanilla's view bobbing. Each value is written as the type the pack declared (an `int` declared `float` still works). - The game passes what only it knows (day time, weather levels, fluid and light at the camera, blindness, F1, brightness) in `Frame::pack`, only when `HORIZON_SHADER_PACK` is set. - **Fix to #1601 (slice 4):** programs drawing to buffers read `gl_FragCoord` through a variable only `final` set, so it read 0. Every target sets it now, with a test. Found by the first frame drawn with a pack. Nothing reads the uniforms until the next PR: players see no change (`skip-release`). ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §5.2 (F-class rows), §5.5, §5.6, OQ-26 and OQ-36; no other loader's code read. Decisions (smoothing per frame in seconds, fog from the nearer of vanilla's two fogs) are in the clean room's `impl-plan.md`. ## How tested Unit tests: values written as the declared type, values past the block dropped; noon puts the sun straight up and a quarter turn later it sets in the west; `gl_FragCoord` set for both targets. The values themselves are checked on screen in the next PR (the test pack's depth bands use `gbufferProjectionInverse`, `far`, `viewWidth`). ## Self-check (whole stack, on its top branch `feat/shader-packs-post`) **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 16d49fe66, 33 min 27 s) | Check | Result | | --- | --- | | Scope | ⚠️ 35 files, +5328 −13; 5068 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ (1 s) | | Python tests | ➖ no Python change | | rustfmt | ✅ (18 s) | | clippy | ✅ (2 min 38 s) | | tests: workspace | ✅ 1965 passed (26 min 23 s) | | doc tests | ✅ 1 passed (4 min 7 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more | | Label | `skip-release`: players see nothing without `HORIZON_SHADER_PACK` | Parity: 326 harnesses selected (the root `Cargo.toml`, then `gfx.rs` and `game.rs` in the last PR); CI runs them. The renderer changes only act when a pack is loaded: without `HORIZON_SHADER_PACK` the world target, depth stores and passes are as before. ## Needs Ludovic Nothing for this PR. Label `skip-release`: it runs only behind `HORIZON_SHADER_PACK`; the first visible slice is the Shader Packs page (slice 9). 🤖 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 04:11:15 +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#3664
No description provided.