[PR #2521] [MERGED] Scroll and add the energy swirl of charged creepers and powered withers #4391

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

📋 Pull Request Information

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

Base: main ← Head: feat/energy-swirl


📝 Commits (3)

  • f6db8b1 Scroll and add the energy swirl of charged creepers and powered withers
  • f4271d7 Merge #2492 into the energy swirl branch
  • e2b35bc Merge main into feat/energy-swirl

📊 Changes

5 files changed (+115 additions, -21 deletions)

View changed files

📝 crates/horizon-client/src/entity.wgsl (+14 -0)
📝 crates/horizon-client/src/gfx.rs (+43 -2)
📝 crates/horizon-client/src/gfx/entity_batch.rs (+15 -8)
📝 crates/horizon-client/src/gfx/pack_entities.rs (+3 -3)
📝 crates/horizon-client/src/mobs/render.rs (+40 -8)

📄 Description

What and why

The charged creeper's energy swirl did not scroll, was drawn with the wrong blend and colour (half-transparent white over the body), and the powered wither had no swirl at all.

This adds an energy swirl draw: the armour model is drawn additively (one, one), unlit, with the sprite scrolled by the layer's texture offset and repeated within its own area of the atlas. The colour is 0xFF808080. A charged creeper scrolls by t * 0.01 on both axes. A wither at or below half health draws its armour model scrolling by cos(t * 0.02) * 3 across and t * 0.01 down.

Swirl quads use their own overlay code, like the water mask and shadows, and get their own pipeline and draw. The wither state already reaches the client through the health entity data, and the creeper state through the powered entity data, so the single player server thread, --in-frame and LAN guests draw it the same way. While a shader pack draws entities, an entity holding swirl quads is drawn by Horizon itself instead of the pack.

Vanilla reference

EnergySwirlLayer.submit, CreeperPowerLayer, WitherArmorLayer, RenderTypes.energySwirl, RenderPipelines.ENERGY_SWIRL (additive blend, emissive, no overlay, no cardinal lighting, no culling), WitherBoss.isPowered.

Self-check

cargo check -p horizon-client passes, and clippy with warnings denied.

In game (/summon creeper ... {powered:1b,NoAI:1b} and a wither with 100 health): two screenshots a second or two apart show the creeper's blue swirl and the wither's armour pattern in different positions, and the plain creeper beside it is unchanged.

Not checked: a shader pack with entity programs.


🔄 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/2521 **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:** `feat/energy-swirl` --- ### 📝 Commits (3) - [`f6db8b1`](https://github.com/horizon-rust/horizon/commit/f6db8b1f56227da23ff72407c8af3e8ca081f6a5) Scroll and add the energy swirl of charged creepers and powered withers - [`f4271d7`](https://github.com/horizon-rust/horizon/commit/f4271d7c16e30a24bec7a7d0e2557ac7ceca9e72) Merge #2492 into the energy swirl branch - [`e2b35bc`](https://github.com/horizon-rust/horizon/commit/e2b35bc827ac9d65bd3ed4eae7d2af3a1bfbeca6) Merge main into feat/energy-swirl ### 📊 Changes **5 files changed** (+115 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity.wgsl` (+14 -0) 📝 `crates/horizon-client/src/gfx.rs` (+43 -2) 📝 `crates/horizon-client/src/gfx/entity_batch.rs` (+15 -8) 📝 `crates/horizon-client/src/gfx/pack_entities.rs` (+3 -3) 📝 `crates/horizon-client/src/mobs/render.rs` (+40 -8) </details> ### 📄 Description ## What and why The charged creeper's energy swirl did not scroll, was drawn with the wrong blend and colour (half-transparent white over the body), and the powered wither had no swirl at all. This adds an energy swirl draw: the armour model is drawn additively (one, one), unlit, with the sprite scrolled by the layer's texture offset and repeated within its own area of the atlas. The colour is 0xFF808080. A charged creeper scrolls by `t * 0.01` on both axes. A wither at or below half health draws its armour model scrolling by `cos(t * 0.02) * 3` across and `t * 0.01` down. Swirl quads use their own overlay code, like the water mask and shadows, and get their own pipeline and draw. The wither state already reaches the client through the health entity data, and the creeper state through the powered entity data, so the single player server thread, `--in-frame` and LAN guests draw it the same way. While a shader pack draws entities, an entity holding swirl quads is drawn by Horizon itself instead of the pack. ## Vanilla reference `EnergySwirlLayer.submit`, `CreeperPowerLayer`, `WitherArmorLayer`, `RenderTypes.energySwirl`, `RenderPipelines.ENERGY_SWIRL` (additive blend, emissive, no overlay, no cardinal lighting, no culling), `WitherBoss.isPowered`. ## Self-check `cargo check -p horizon-client` passes, and clippy with warnings denied. In game (`/summon creeper ... {powered:1b,NoAI:1b}` and a wither with 100 health): two screenshots a second or two apart show the creeper's blue swirl and the wither's armour pattern in different positions, and the plain creeper beside it is unchanged. Not checked: a shader pack with entity programs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:49 +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#4391
No description provided.