[PR #6286] [MERGED] Render inline text sprite shadows like vanilla #6769

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6286
Author: @xMelonekMaX
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/inline-sprite-shadows


📝 Commits (1)

  • 7ab188c fix: render inline text sprite shadows like vanilla

📊 Changes

5 files changed (+247 additions, -9 deletions)

View changed files

📝 crates/horizon-client-render/src/hud.rs (+21 -9)
➕ crates/horizon-client/examples/probe/inline_object_fixture.rs (+69 -0)
📝 crates/horizon-client/examples/probe/main.rs (+2 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaInlineObjectOracle.java (+91 -0)
➕ tools/test_inline_object_parity.py (+64 -0)

📄 Description

🤖 Opened by xMelonekMaX's AI agent (Codex, GPT-6), not by xMelonekMaX personally.

What and why

Fixes #6271.

Inline sprites in text components skipped the text shadow pass, so an icon beside ordinary text had no shadow. Render inline atlas sprites and player heads in that pass, using vanilla's one-pixel offset, text/shadow tint and alpha. Match the sprite baseline and place the foreground at Font.SHADOW_DEPTH for world text.

Custom shadow_color overrides and shadow_color: 0 follow the existing text shadow selection. The change is limited to the renderer and its regression tests: five files, +247/−9 lines.

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

Inspected the pinned 26.3 client jar with javap -p -c:

  • Font.PreparedTextBuilder.accept / getShadowColor: foreground/shadow colors and glyph shadow offset.
  • PlainTextRenderable.render: shadow at the supplied offset, followed by the foreground; world foreground depth is 0.03 when a shadow is present.
  • AtlasGlyphProvider.Instance.renderSprite and PlainTextRenderable.top: sprite geometry and baseline.
  • PlayerGlyphProvider.Instance: uses the same PlainTextRenderable shadow path.

New harness: tools/test_inline_object_parity.py, VanillaInlineObjectOracle.java and inline_object_fixture.rs. It exercises the real vanilla Font.prepareText and atlas glyph renderer with a synthetic atlas region, without a GPU.

Other projects' code

none

Verification

  • python3 tools/parity.py --fresh inline_object: 96 cases, 252 output lines agree with vanilla.
  • python3 tools/parity.py --repeat 3 inline_object: three consecutive passes.
  • cargo test -p horizon-client-render --lib hud::tests:: -- --test-threads=2: 27 passed, including inline head shadow regression coverage.
  • Clippy with -D warnings passes for horizon-client-render and horizon-client libraries and client_probe, using --no-default-features and one consistent Rust toolchain.
  • rustfmt, diff whitespace and public-tree/history checks pass.
  • Manual in-game verification: the contributor ran the fixed client on Fedora 44 and confirmed that sprite shadows render correctly.

The differential test covers sprite bounds, shadow displacement, tint, alpha, explicit shadow suppression/override and world depth. It does not compare final GPU pixels, atlas loading or player skin lookup.

Self-check

pr_ready (tools/pr_ready.py --quick on 192, against origin/main at 1e02316c2, 1 min 2 s)

Check Result
Scope ✅ 6 files, +248 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 586 run, FAILED (errors=1, skipped=1) (34 s)
rustfmt ✅ (9 s)
Rust ⚠️ 1.98.1 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ❌ failed; likely the old Rust above (2 s)
tests: horizon-client, horizon-client-render ❌ failed (12 s)
doc tests ❌ failed (4 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 ➖ 375 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 363 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The report above is from the local checkout at 7ab188cf5, against local origin/main at 1e02316c2. Its scope also includes one untracked local file that is excluded from this five-file PR.

Outstanding full-check failures:

  • Default-feature builds cannot locate alsa.pc (ALSA development files are not installed). The focused renderer/probe checks above passed without audio/controller features.
  • The Python test test_mod_block_entity_any_template fails because its Entities fixture lacks has_mods. This is outside this change; upstream has since merged #6143 to fix that fixture.
  • This self-check used a consistent Rust/Clippy 1.98.1 toolchain; the runner warns that CI stable is 1.99. The earlier system Rust/Clippy version mismatch was avoided for the successful focused Clippy check.
  • The full affected parity suite was not run (--quick); the new inline_object harness was separately run fresh and passed three consecutive runs.

These are reported as incomplete validation, not a clean full self-check. Results must be refreshed if the branch is updated to current main.

Screenshots

The same server menu before and after the fix. Inline icons beside ITEM SHOP, KITS, LEVEL and GUIDE now render shadows like the surrounding text.

The camera background differs between captures; compare the menu icons.

Before After
Before: inline icons without shadows After: inline icons with shadows

🤖 Generated with Codex


🔄 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/6286 **Author:** [@xMelonekMaX](https://github.com/xMelonekMaX) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/inline-sprite-shadows` --- ### 📝 Commits (1) - [`7ab188c`](https://github.com/horizon-rust/horizon/commit/7ab188cf5ac85975e7c3c1ea3182f6009ab104a3) fix: render inline text sprite shadows like vanilla ### 📊 Changes **5 files changed** (+247 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/hud.rs` (+21 -9) ➕ `crates/horizon-client/examples/probe/inline_object_fixture.rs` (+69 -0) 📝 `crates/horizon-client/examples/probe/main.rs` (+2 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaInlineObjectOracle.java` (+91 -0) ➕ `tools/test_inline_object_parity.py` (+64 -0) </details> ### 📄 Description > 🤖 Opened by xMelonekMaX's AI agent (Codex, GPT-6), not by xMelonekMaX personally. ## What and why Fixes #6271. Inline sprites in text components skipped the text shadow pass, so an icon beside ordinary text had no shadow. Render inline atlas sprites and player heads in that pass, using vanilla's one-pixel offset, text/shadow tint and alpha. Match the sprite baseline and place the foreground at `Font.SHADOW_DEPTH` for world text. Custom `shadow_color` overrides and `shadow_color: 0` follow the existing text shadow selection. The change is limited to the renderer and its regression tests: five files, +247/−9 lines. ## Kind - [x] 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 Inspected the pinned 26.3 client jar with `javap -p -c`: - `Font.PreparedTextBuilder.accept` / `getShadowColor`: foreground/shadow colors and glyph shadow offset. - `PlainTextRenderable.render`: shadow at the supplied offset, followed by the foreground; world foreground depth is `0.03` when a shadow is present. - `AtlasGlyphProvider.Instance.renderSprite` and `PlainTextRenderable.top`: sprite geometry and baseline. - `PlayerGlyphProvider.Instance`: uses the same `PlainTextRenderable` shadow path. New harness: `tools/test_inline_object_parity.py`, `VanillaInlineObjectOracle.java` and `inline_object_fixture.rs`. It exercises the real vanilla `Font.prepareText` and atlas glyph renderer with a synthetic atlas region, without a GPU. ## Other projects' code none ## Verification - `python3 tools/parity.py --fresh inline_object`: 96 cases, 252 output lines agree with vanilla. - `python3 tools/parity.py --repeat 3 inline_object`: three consecutive passes. - `cargo test -p horizon-client-render --lib hud::tests:: -- --test-threads=2`: 27 passed, including inline head shadow regression coverage. - Clippy with `-D warnings` passes for `horizon-client-render` and `horizon-client` libraries and `client_probe`, using `--no-default-features` and one consistent Rust toolchain. - rustfmt, diff whitespace and public-tree/history checks pass. - Manual in-game verification: the contributor ran the fixed client on Fedora 44 and confirmed that sprite shadows render correctly. The differential test covers sprite bounds, shadow displacement, tint, alpha, explicit shadow suppression/override and world depth. It does not compare final GPU pixels, atlas loading or player skin lookup. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 192, against origin/main at 1e02316c2, 1 min 2 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +248 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 586 run, FAILED (errors=1, skipped=1) (34 s) | | rustfmt | ✅ (9 s) | | Rust | ⚠️ 1.98.1 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ❌ failed; likely the old Rust above (2 s) | | tests: horizon-client, horizon-client-render | ❌ failed (12 s) | | doc tests | ❌ failed (4 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 | ➖ 375 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 363 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The report above is from the local checkout at `7ab188cf5`, against local `origin/main` at `1e02316c2`. Its scope also includes one untracked local file that is excluded from this five-file PR. Outstanding full-check failures: - Default-feature builds cannot locate `alsa.pc` (ALSA development files are not installed). The focused renderer/probe checks above passed without audio/controller features. - The Python test `test_mod_block_entity_any_template` fails because its `Entities` fixture lacks `has_mods`. This is outside this change; upstream has since merged [#6143](https://github.com/horizon-rust/horizon/pull/6143) to fix that fixture. - This self-check used a consistent Rust/Clippy 1.98.1 toolchain; the runner warns that CI stable is 1.99. The earlier system Rust/Clippy version mismatch was avoided for the successful focused Clippy check. - The full affected parity suite was not run (`--quick`); the new `inline_object` harness was separately run fresh and passed three consecutive runs. These are reported as incomplete validation, not a clean full self-check. Results must be refreshed if the branch is updated to current main. ## Screenshots The same server menu before and after the fix. Inline icons beside ITEM SHOP, KITS, LEVEL and GUIDE now render shadows like the surrounding text. The camera background differs between captures; compare the menu icons. | Before | After | | --- | --- | | ![Before: inline icons without shadows](https://github.com/user-attachments/assets/a45465e5-5b18-4714-be75-bb4e8afce471) | ![After: inline icons with shadows](https://github.com/user-attachments/assets/df28b5fa-c8ec-416a-b4d6-e50ad778e5b7) | 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:20 +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#6769
No description provided.