[PR #2537] [MERGED] Draw entity outlines for the Glowing effect #4406

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

📋 Pull Request Information

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

Base: main ← Head: feat/glowing


📝 Commits (2)

  • e544924 Draw entity outlines for the Glowing effect
  • 03cbb48 Merge main into feat/glowing

📊 Changes

12 files changed (+558 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/entity.wgsl (+7 -0)
📝 crates/horizon-client/src/game.rs (+9 -0)
📝 crates/horizon-client/src/game/creatures.rs (+25 -3)
➕ crates/horizon-client/src/game/glowing.rs (+53 -0)
📝 crates/horizon-client/src/game/item_draw.rs (+6 -1)
📝 crates/horizon-client/src/game/lan.rs (+15 -3)
📝 crates/horizon-client/src/game/perspective.rs (+10 -0)
📝 crates/horizon-client/src/game/remote.rs (+29 -1)
📝 crates/horizon-client/src/gfx.rs (+28 -1)
➕ crates/horizon-client/src/gfx/entity_outline.rs (+311 -0)
➕ crates/horizon-client/src/gfx/entity_outline.wgsl (+60 -0)
📝 crates/horizon-client/src/mobs.rs (+5 -0)

📄 Description

What and why

Horizon drew no entity outline at all, so the Glowing effect, spectral arrows and the Glowing tag showed nothing. This adds vanilla's entity outline:

  • The renderer gets an outline target. Glowing entities are drawn into it as flat silhouettes in their team colour (white without a team), with no depth test, so they show through walls. The texture's alpha still cuts the shape, like rendertype_outline.
  • Over it runs the entity_outline post chain: entity_sobel, then entity_outline_box_blur across and up with radius 2, then the blended blit onto the frame after the hand, colour channels only.
  • Mobs, other players, LAN guests (seen by the host), the player in third person, item entities and projectiles get outlines. An invisible glowing mob draws its outline only, as LivingEntityRenderer.getRenderType does. Glowing entities skip Horizon's entity culling.
  • The server now sends shared flag 6 (0x40) for mobs (the Glowing effect or tag) and item entities (the tag). The remote client reads it from entity data for mobs, items and projectiles, so the server thread, --in-frame and LAN guests all show it.
  • The remote client keeps entity UUIDs from AddEntity, so a mob's team colour works on a server that sends real UUIDs.

Not covered: the spectator "highlight players" key (unbound by default and not wired to any input here), and team colours for mobs on Horizon's own server, which still sends placeholder entity UUIDs, so a client cannot match a mob to its team yet (those outlines stay white). Players' team colours work everywhere because teams list players by name. Glowing players seen by other players depend on #2429, which sends the player flags.

Fixes #2014.

Vanilla reference

  • Entity.isCurrentlyGlowing, LivingEntity.isCurrentlyGlowing and updateGlowingStatus (shared flag 6), Entity.getTeamColor.
  • Minecraft.shouldEntityAppearGlowing, EntityRenderer.extractRenderState (outlineColor), LivingEntityRenderer.getRenderType (outline only when invisible).
  • RenderTypes.outline, RenderPipelines.OUTLINE_CULL/OUTLINE_NO_CULL, core/rendertype_outline.fsh.
  • LevelRenderer.entityOutlineTarget, executeOutline and blitEntityOutline; RenderTarget.blitAndBlendToTexture with RenderPipelines.ENTITY_OUTLINE_BLIT (BlendFunction.ENTITY_OUTLINE_BLIT, write mask 7).
  • post_effect/entity_outline.json, post/entity_sobel.fsh, post/entity_outline_box_blur.fsh, core/blit_screen.fsh.

Self-check

cargo check -p horizon-client passes.

In game (server thread and --in-frame): after /effect give @e[type=cow] glowing the cows show white outlines through a stone wall; a zombie on a red team shows a red outline (--in-frame); a summoned item with Glowing:1b is outlined; the player in third person with the effect is outlined in its team's aqua.


🔄 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/2537 **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/glowing` --- ### 📝 Commits (2) - [`e544924`](https://github.com/horizon-rust/horizon/commit/e544924504808587d7a3375186dc05c7e9458879) Draw entity outlines for the Glowing effect - [`03cbb48`](https://github.com/horizon-rust/horizon/commit/03cbb48fa4b16c5d00c9b79522e1425b707c8968) Merge main into feat/glowing ### 📊 Changes **12 files changed** (+558 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity.wgsl` (+7 -0) 📝 `crates/horizon-client/src/game.rs` (+9 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+25 -3) ➕ `crates/horizon-client/src/game/glowing.rs` (+53 -0) 📝 `crates/horizon-client/src/game/item_draw.rs` (+6 -1) 📝 `crates/horizon-client/src/game/lan.rs` (+15 -3) 📝 `crates/horizon-client/src/game/perspective.rs` (+10 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+29 -1) 📝 `crates/horizon-client/src/gfx.rs` (+28 -1) ➕ `crates/horizon-client/src/gfx/entity_outline.rs` (+311 -0) ➕ `crates/horizon-client/src/gfx/entity_outline.wgsl` (+60 -0) 📝 `crates/horizon-client/src/mobs.rs` (+5 -0) </details> ### 📄 Description ## What and why Horizon drew no entity outline at all, so the Glowing effect, spectral arrows and the `Glowing` tag showed nothing. This adds vanilla's entity outline: - The renderer gets an outline target. Glowing entities are drawn into it as flat silhouettes in their team colour (white without a team), with no depth test, so they show through walls. The texture's alpha still cuts the shape, like `rendertype_outline`. - Over it runs the `entity_outline` post chain: `entity_sobel`, then `entity_outline_box_blur` across and up with radius 2, then the blended blit onto the frame after the hand, colour channels only. - Mobs, other players, LAN guests (seen by the host), the player in third person, item entities and projectiles get outlines. An invisible glowing mob draws its outline only, as `LivingEntityRenderer.getRenderType` does. Glowing entities skip Horizon's entity culling. - The server now sends shared flag 6 (0x40) for mobs (the Glowing effect or tag) and item entities (the tag). The remote client reads it from entity data for mobs, items and projectiles, so the server thread, `--in-frame` and LAN guests all show it. - The remote client keeps entity UUIDs from `AddEntity`, so a mob's team colour works on a server that sends real UUIDs. Not covered: the spectator "highlight players" key (unbound by default and not wired to any input here), and team colours for mobs on Horizon's own server, which still sends placeholder entity UUIDs, so a client cannot match a mob to its team yet (those outlines stay white). Players' team colours work everywhere because teams list players by name. Glowing players seen by other players depend on #2429, which sends the player flags. Fixes #2014. ## Vanilla reference - `Entity.isCurrentlyGlowing`, `LivingEntity.isCurrentlyGlowing` and `updateGlowingStatus` (shared flag 6), `Entity.getTeamColor`. - `Minecraft.shouldEntityAppearGlowing`, `EntityRenderer.extractRenderState` (`outlineColor`), `LivingEntityRenderer.getRenderType` (outline only when invisible). - `RenderTypes.outline`, `RenderPipelines.OUTLINE_CULL`/`OUTLINE_NO_CULL`, `core/rendertype_outline.fsh`. - `LevelRenderer.entityOutlineTarget`, `executeOutline` and `blitEntityOutline`; `RenderTarget.blitAndBlendToTexture` with `RenderPipelines.ENTITY_OUTLINE_BLIT` (`BlendFunction.ENTITY_OUTLINE_BLIT`, write mask 7). - `post_effect/entity_outline.json`, `post/entity_sobel.fsh`, `post/entity_outline_box_blur.fsh`, `core/blit_screen.fsh`. ## Self-check `cargo check -p horizon-client` passes. In game (server thread and `--in-frame`): after `/effect give @e[type=cow] glowing` the cows show white outlines through a stone wall; a zombie on a red team shows a red outline (`--in-frame`); a summoned item with `Glowing:1b` is outlined; the player in third person with the effect is outlined in its team's aqua. --- <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:56 +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#4406
No description provided.