[PR #7245] [MERGED] Shader packs: Iris's cloudTime uniform #7440

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7245
Author: @arslanarm
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: shaderpacks/cloud-time


📝 Commits (2)

📊 Changes

3 files changed (+39 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/clouds.rs (+7 -1)
📝 crates/horizon-client-render/src/gfx/pack_uniforms.rs (+25 -0)
📝 crates/horizon-client/src/game/shader_packs.rs (+7 -0)

📄 Description

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

What and why

Part of #6812.

Iris 1.11.7 gives packs a cloudTime uniform that ShaderDoc does not list. Horizon read it as zero: "zero for now: cloudTime" in eleven of Shrimple v0.12's programs (dimension 0).

Probed black-box, it is how far the game's clouds have drifted along X, in blocks. That is vanilla's CloudRenderer.prepare: cloudOffset = (gameTime % (texture.width * 400)) + partialTicks, moved cloudOffset * 0.030000001F blocks.

  • clouds::drift(time, partial_tick, width) is that cloudOffset. The cloud renderer now uses it too, with no change to what it computes.
  • pack_uniforms: cloudTime is provided, from the new PackInputs::cloud_time.
  • game/shader_packs.rs fills it from the world's game time, the partial tick and the cloud texture's width, times 0.030000001 in f32.

How it was found (black-box only)

  1. The game's log on main (fbb17c980), Shrimple, 3 scenes: "zero for now: cloudTime" for composite5, 12, 14, 18, deferred10, gbuffers_clouds, gbuffers_entities, gbuffers_entities_translucent, gbuffers_terrain, gbuffers_textured_lit and gbuffers_weather. The name is not in ShaderDoc's uniforms.
  2. Probe pack uniforms (my own): a final that paints a stripe white where a uniform is not 0. In Iris, cloudTime was not 0.
  3. Probe pack uvalues (my own): it paints each uniform's float bits, one byte per stripe, and the screenshot is read back. Iris, scenes noon / sunset / night, which are about four seconds apart:
    • cloudTime 157.98 / 160.56 / 163.11;
    • frameTimeCounter 14.63 / 18.70 / 22.73.
      The scene world is saved at game time 5073 (its level.dat), and 157.98 / 0.03 = 5266, about ten seconds of ticks after loading. The steps of 2.58 and 2.55 come to about 0.03 a tick. That matches vanilla's cloud drift, read in CloudRenderer.prepare and LevelRenderer.prepareTranslucents (decompiled 26.3, .local).
  4. The same probe on this branch (with vignette=false, so the bytes survive), same world: 155.44 / 157.98 / 160.51. It moves 0.03 a tick from the same start. It is a little lower than Iris's, probably because Horizon reaches the scene sooner (frameTimeCounter 5.24 s at noon against Iris's 14.63 s).

I did not open, extract, or read any pack's files, nor Horizon's preprocessed or translated text of any pack. Everything about Shrimple above comes from the game's ordinary log and screenshots.

Measured

  • real_packs (SHOW_ERRORS=1): identical apart from timings, main fbb17c980 vs this branch (on 11440651b), for Shrimple alone and for 37 of the 40 packs (all but FastPBR, Kappa and Nostalgia, which this machine's rules keep from being run). This changes no translation.
  • In the game (fast builds, Xvfb, fresh homes, scenes ow_ground_noon, ow_ground_sunset, ow_ground_night; main fbb17c980, this branch on 11440651b):
    • the log no longer has cloudTime among "zero for now";
    • gbuffers_clouds, gbuffers_textured_lit, gbuffers_weather, composite5, 14, 18 and deferred10 no longer have a "zero for now" note at all.
  • The picture is unchanged. Mean absolute difference to Iris 1.11.7, in 0..255, main → this branch: noon 92.8 → 92.8, sunset 58.6 → 58.6, night 12.8 → 12.8. Shrimple is still almost black for other reasons (see #6812), so there are no screenshots.

Tests

gfx::pack_uniforms::tests::cloud_time_is_how_far_the_clouds_drifted: cloudTime reaches a pack. The value is Iris's 157.98 at 5266 ticks. drift starts again after a trip across the texture. The test uses clouds::drift and PackInputs::cloud_time, which main lacks, so it doesn't build there; it was not run on main.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only (shader packs; vanilla has no such feature). Sources:

  • ShaderDoc's uniform lists (uniforms.md, iris-features.md), which don't have cloudTime.
  • The value follows vanilla's CloudRenderer.prepare (cloudOffset, 0.030000001F) and LevelRenderer.prepareTranslucents (game time and partial tick).
  • Black-box runs of Iris 1.11.7 with probe packs of my own.

Other projects' code

none. No Iris, OptiFine or pack code read; Shrimple was only run as a black box.

Self-check

pr_ready (tools/pr_ready.py --quick on plony-pc, against origin/main at 11440651b, 8 min 4 s)

Check Result
Scope ✅ 3 files, +39 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (1 min 7 s)
rustfmt ✅ (9 s)
clippy ✅ (2 min 58 s)
tests: horizon-client, horizon-client-render ✅ 1837 passed (3 min 10 s)
doc tests ✅ 0 passed (20 s)
content root tests ➖ content root untouched
mod API up to date ✅ (19 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/7245 **Author:** [@arslanarm](https://github.com/arslanarm) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shaderpacks/cloud-time` --- ### 📝 Commits (2) - [`38145c2`](https://github.com/horizon-rust/horizon/commit/38145c21a62dbd607a601a93eda7b166419367e4) Shader packs: Iris's cloudTime uniform - [`73f3e0e`](https://github.com/horizon-rust/horizon/commit/73f3e0e888b04b6ec9fae0ddecface2f4f833502) Merge main into #7245 ### 📊 Changes **3 files changed** (+39 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/clouds.rs` (+7 -1) 📝 `crates/horizon-client-render/src/gfx/pack_uniforms.rs` (+25 -0) 📝 `crates/horizon-client/src/game/shader_packs.rs` (+7 -0) </details> ### 📄 Description > 🤖 Opened by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. ## What and why Part of #6812. Iris 1.11.7 gives packs a `cloudTime` uniform that ShaderDoc does not list. Horizon read it as zero: "zero for now: cloudTime" in eleven of Shrimple v0.12's programs (dimension 0). Probed black-box, it is how far the game's clouds have drifted along X, in blocks. That is vanilla's `CloudRenderer.prepare`: `cloudOffset = (gameTime % (texture.width * 400)) + partialTicks`, moved `cloudOffset * 0.030000001F` blocks. - `clouds::drift(time, partial_tick, width)` is that `cloudOffset`. The cloud renderer now uses it too, with no change to what it computes. - `pack_uniforms`: `cloudTime` is provided, from the new `PackInputs::cloud_time`. - `game/shader_packs.rs` fills it from the world's game time, the partial tick and the cloud texture's width, times 0.030000001 in `f32`. ### How it was found (black-box only) 1. The game's log on main (fbb17c980), Shrimple, 3 scenes: "zero for now: cloudTime" for `composite5`, `12`, `14`, `18`, `deferred10`, `gbuffers_clouds`, `gbuffers_entities`, `gbuffers_entities_translucent`, `gbuffers_terrain`, `gbuffers_textured_lit` and `gbuffers_weather`. The name is not in ShaderDoc's uniforms. 2. Probe pack `uniforms` (my own): a `final` that paints a stripe white where a uniform is not 0. In Iris, `cloudTime` was not 0. 3. Probe pack `uvalues` (my own): it paints each uniform's float bits, one byte per stripe, and the screenshot is read back. Iris, scenes noon / sunset / night, which are about four seconds apart: - `cloudTime` 157.98 / 160.56 / 163.11; - `frameTimeCounter` 14.63 / 18.70 / 22.73. The scene world is saved at game time 5073 (its `level.dat`), and 157.98 / 0.03 = 5266, about ten seconds of ticks after loading. The steps of 2.58 and 2.55 come to about 0.03 a tick. That matches vanilla's cloud drift, read in `CloudRenderer.prepare` and `LevelRenderer.prepareTranslucents` (decompiled 26.3, `.local`). 4. The same probe on this branch (with `vignette=false`, so the bytes survive), same world: 155.44 / 157.98 / 160.51. It moves 0.03 a tick from the same start. It is a little lower than Iris's, probably because Horizon reaches the scene sooner (`frameTimeCounter` 5.24 s at noon against Iris's 14.63 s). I did not open, extract, or read any pack's files, nor Horizon's preprocessed or translated text of any pack. Everything about Shrimple above comes from the game's ordinary log and screenshots. ### Measured - `real_packs` (`SHOW_ERRORS=1`): identical apart from timings, main fbb17c980 vs this branch (on 11440651b), for Shrimple alone and for 37 of the 40 packs (all but FastPBR, Kappa and Nostalgia, which this machine's rules keep from being run). This changes no translation. - In the game (fast builds, Xvfb, fresh homes, scenes `ow_ground_noon`, `ow_ground_sunset`, `ow_ground_night`; main fbb17c980, this branch on 11440651b): - the log no longer has `cloudTime` among "zero for now"; - `gbuffers_clouds`, `gbuffers_textured_lit`, `gbuffers_weather`, `composite5`, `14`, `18` and `deferred10` no longer have a "zero for now" note at all. - The picture is unchanged. Mean absolute difference to Iris 1.11.7, in 0..255, main → this branch: noon 92.8 → 92.8, sunset 58.6 → 58.6, night 12.8 → 12.8. Shrimple is still almost black for other reasons (see #6812), so there are no screenshots. ### Tests `gfx::pack_uniforms::tests::cloud_time_is_how_far_the_clouds_drifted`: `cloudTime` reaches a pack. The value is Iris's 157.98 at 5266 ticks. `drift` starts again after a trip across the texture. The test uses `clouds::drift` and `PackInputs::cloud_time`, which main lacks, so it doesn't build there; it was not run on main. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only (shader packs; vanilla has no such feature). Sources: - ShaderDoc's uniform lists (`uniforms.md`, `iris-features.md`), which don't have `cloudTime`. - The value follows vanilla's `CloudRenderer.prepare` (`cloudOffset`, `0.030000001F`) and `LevelRenderer.prepareTranslucents` (game time and partial tick). - Black-box runs of Iris 1.11.7 with probe packs of my own. ## Other projects' code none. No Iris, OptiFine or pack code read; Shrimple was only run as a black box. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on plony-pc, against origin/main at 11440651b, 8 min 4 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +39 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (1 min 7 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (2 min 58 s) | | tests: horizon-client, horizon-client-render | ✅ 1837 passed (3 min 10 s) | | doc tests | ✅ 0 passed (20 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (19 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 06:39:33 +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#7440
No description provided.