[PR #2843] [MERGED] The breeze's wind and the wind charge scroll their textures #4650

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2843
Author: @levzzz5154
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/breeze-wind-scroll


📝 Commits (1)

  • f507a06 The breeze's wind and the wind charge scroll their textures

📊 Changes

2 files changed (+89 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/game/wind.rs (+5 -1)
📝 crates/horizon-client/src/mobs/render.rs (+84 -12)

📄 Description

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

What and why

Vanilla draws the breeze's gust and the wind charge with a texture that scrolls. RenderTypes.breezeWind takes the texture's age times a speed and the render type's texture matrix moves the texture under the model:

  • BreezeWindLayer scrolls the breeze's wind layer by 0.02 of the texture per tick (xOffset(t) { return t * 0.02F; }).
  • WindChargeRenderer scrolls the wind charge's texture by 0.03 of the texture per tick (xOffset(t) { return t * 0.03F; }).

Horizon drew both with a still texture - the code even said so: "BreezeWindLayer (the scroll is not reproduced: atlas sprites do not wrap)" - so the breeze's gust did not move and the wind charge only turned as a whole.

This pull request reproduces the scroll:

  • the draw takes a scroll offset, and the vertex's U moves by it and wraps around the texture;
  • the breeze's wind layer scrolls at 0.02 and the wind charge's at 0.03, both from the entity's age.

The model's geometry, the breeze's six keyframe animations (BreezeModel.setupAnim applies IDLE, SHOOT, SLIDE, SLIDE_BACK, INHALE and JUMP) and the wind charge's own turn (WindChargeModel.setupAnim turns wind_charge and wind) were already there and are untouched.

Fixes #2760

Vanilla reference

  • net.minecraft.client.renderer.entity.layers.BreezeWindLayer#submit and xOffset: the breeze's wind layer is drawn with RenderTypes.breezeWind(TEXTURE_LOCATION, xOffset(ageInTicks) % 1.0F, 0.0F), scrolling at 0.02 per tick.
  • net.minecraft.client.renderer.entity.WindChargeRenderer#submit and xOffset: the wind charge's texture scrolls at 0.03 per tick.
  • net.minecraft.client.renderer.RenderTypes#breezeWind: the render type whose texture matrix moves the texture.
  • net.minecraft.client.model.object.projectile.WindChargeModel#setupAnim: the model parts' turn, which Horizon already had.
  • net.minecraft.client.model.monster.breeze.BreezeModel#setupAnim: the breeze's six keyframe animations, which Horizon already had.

Self-check

$ cargo test -p horizon-client --lib
test result: ok. 1170 passed; 0 failed; 0 ignored; 0 measured; 33 filtered out; finished in 43.26s

with the two new tests:

test mobs::render::scroll_tests::the_scrolled_u_wraps_inside_the_texture ... ok
test mobs::render::scroll_tests::the_scrolling_texture_wraps_around ... ok

They pin the rule: the offset is the age times the speed modulo one (0.02 for the breeze's wind layer, 0.03 for the wind charge), and the vertex's U moves by it and wraps around the texture, while a draw without a scroll keeps the vertex's own U (including the texture's edge at 1.0). Before this change the rule did not exist at all - the scroll was not reproduced at all - and the helpers the tests call are only reachable from the two scrolling draws, so the CI's cargo clippy --workspace --all-targets -- -D warnings rejects the build when the calls are taken out.

cargo fmt -p horizon-client is clean.

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, against upstream/main at 6f4b1bf4c, 4 min 41 s)

Check Result
Scope ✅ 2 files, +89 −13
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 336 passed (18 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 16 s)
tests: horizon-client ✅ 1331 passed (2 min 14 s)
doc tests ✅ 0 passed (34 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 74 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 62 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The clippy row is not this change: the lint is in crates/horizon-world/src/datafix/chunk_flatten.rs and in the client's own lib test code (the local clippy is 1.95, newer than the toolchain the repository pins); neither file is touched here, and cargo clippy -p horizon-client --all-targets reports nothing for crates/horizon-client/src/mobs/render.rs or crates/horizon-client/src/game/wind.rs.

One difference from the vanilla worth naming: the vanilla's texture matrix wraps per fragment, and the atlas here has no texture matrix, so the wrap is per vertex. The texture that crosses the texture's edge is interpolated instead of wrapped, which shows only in the band where the wrap happens.

🤖 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/2843 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/breeze-wind-scroll` --- ### 📝 Commits (1) - [`f507a06`](https://github.com/horizon-rust/horizon/commit/f507a067cd4054079b5bfc05d4f6aca3d7655ec8) The breeze's wind and the wind charge scroll their textures ### 📊 Changes **2 files changed** (+89 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/wind.rs` (+5 -1) 📝 `crates/horizon-client/src/mobs/render.rs` (+84 -12) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself. ## What and why Vanilla draws the breeze's gust and the wind charge with a texture that scrolls. `RenderTypes.breezeWind` takes the texture's age times a speed and the render type's texture matrix moves the texture under the model: - `BreezeWindLayer` scrolls the breeze's wind layer by 0.02 of the texture per tick (`xOffset(t) { return t * 0.02F; }`). - `WindChargeRenderer` scrolls the wind charge's texture by 0.03 of the texture per tick (`xOffset(t) { return t * 0.03F; }`). Horizon drew both with a still texture - the code even said so: *"BreezeWindLayer (the scroll is not reproduced: atlas sprites do not wrap)"* - so the breeze's gust did not move and the wind charge only turned as a whole. This pull request reproduces the scroll: - the draw takes a scroll offset, and the vertex's U moves by it and wraps around the texture; - the breeze's wind layer scrolls at 0.02 and the wind charge's at 0.03, both from the entity's age. The model's geometry, the breeze's six keyframe animations (`BreezeModel.setupAnim` applies IDLE, SHOOT, SLIDE, SLIDE_BACK, INHALE and JUMP) and the wind charge's own turn (`WindChargeModel.setupAnim` turns `wind_charge` and `wind`) were already there and are untouched. Fixes #2760 ## Vanilla reference - `net.minecraft.client.renderer.entity.layers.BreezeWindLayer#submit` and `xOffset`: the breeze's wind layer is drawn with `RenderTypes.breezeWind(TEXTURE_LOCATION, xOffset(ageInTicks) % 1.0F, 0.0F)`, scrolling at 0.02 per tick. - `net.minecraft.client.renderer.entity.WindChargeRenderer#submit` and `xOffset`: the wind charge's texture scrolls at 0.03 per tick. - `net.minecraft.client.renderer.RenderTypes#breezeWind`: the render type whose texture matrix moves the texture. - `net.minecraft.client.model.object.projectile.WindChargeModel#setupAnim`: the model parts' turn, which Horizon already had. - `net.minecraft.client.model.monster.breeze.BreezeModel#setupAnim`: the breeze's six keyframe animations, which Horizon already had. ## Self-check ``` $ cargo test -p horizon-client --lib test result: ok. 1170 passed; 0 failed; 0 ignored; 0 measured; 33 filtered out; finished in 43.26s ``` with the two new tests: ``` test mobs::render::scroll_tests::the_scrolled_u_wraps_inside_the_texture ... ok test mobs::render::scroll_tests::the_scrolling_texture_wraps_around ... ok ``` They pin the rule: the offset is the age times the speed modulo one (0.02 for the breeze's wind layer, 0.03 for the wind charge), and the vertex's U moves by it and wraps around the texture, while a draw without a scroll keeps the vertex's own U (including the texture's edge at 1.0). Before this change the rule did not exist at all - the scroll was not reproduced at all - and the helpers the tests call are only reachable from the two scrolling draws, so the CI's `cargo clippy --workspace --all-targets -- -D warnings` rejects the build when the calls are taken out. `cargo fmt -p horizon-client` is clean. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, against upstream/main at 6f4b1bf4c, 4 min 41 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +89 −13 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 336 passed (18 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 16 s) | | tests: horizon-client | ✅ 1331 passed (2 min 14 s) | | doc tests | ✅ 0 passed (34 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 74 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 62 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The clippy row is not this change: the lint is in `crates/horizon-world/src/datafix/chunk_flatten.rs` and in the client's own lib test code (the local clippy is 1.95, newer than the toolchain the repository pins); neither file is touched here, and `cargo clippy -p horizon-client --all-targets` reports nothing for `crates/horizon-client/src/mobs/render.rs` or `crates/horizon-client/src/game/wind.rs`. One difference from the vanilla worth naming: the vanilla's texture matrix wraps per fragment, and the atlas here has no texture matrix, so the wrap is per vertex. The texture that crosses the texture's edge is interpolated instead of wrapped, which shows only in the band where the wrap happens. 🤖 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 05:06:57 +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#4650
No description provided.