[PR #3554] [MERGED] Draw glowing sign text in front of its outline #5047

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3554
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix-3293


📝 Commits (1)

  • 6bd34b6 Draw glowing sign text in front of its outline

📊 Changes

1 file changed (+82 additions, -4 deletions)

View changed files

📝 crates/horizon-client-render/src/block_entity_render.rs (+82 -4)

📄 Description

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

What and why

Fixes #3293 (also the duplicate report #2923)

Glowing sign text was hard to read: its letters flickered and broke up into the dark outline around them. block_entity_render.rs draw_text emits the eight one-pixel outline copies and the text itself on the same plane (z = 0 in text space) into the same mesh, so the text and the outline under it z-fight.

Vanilla draws the outline NORMAL and the text over it with Font.DisplayMode.POLYGON_OFFSET, so the coplanar text always wins the depth test. Horizon draws sign text in the block-entity mesh, which has no polygon-offset pass. The fix lifts the text of an outlined call by a twentieth of a font pixel towards the reader (about 0.0005 of a block, too little to see), so it always sits in front of its outline. Text without an outline (ordinary sign text) is unchanged.

Vanilla reference

  • AbstractSignRenderer.submitSignText submits the lines with Font.DisplayMode.POLYGON_OFFSET and the outline colour.
  • TextFeatureRenderer.renderText (26.3, javap): with an outline colour it prepares Font.prepare8xTextOutline and draws it with displayMode = NORMAL, then draws Font.prepareText with displayMode = POLYGON_OFFSET.

Test

New unit test block_entity_render::tests::outlined_sign_text_sits_in_front_of_its_outline: every vertex of an outlined call's text is in front of every outline vertex, and text without an outline stays on the sign's plane.

cargo test -p horizon-client-render --lib block_entity_render::tests::outlined_sign_text

Before (the fix reverted, test kept):

test block_entity_render::tests::outlined_sign_text_sits_in_front_of_its_outline ... FAILED
text z [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] not in front of the outline at 0
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 511 filtered out

After:

test block_entity_render::tests::outlined_sign_text_sits_in_front_of_its_outline ... ok
test result: ok. 1 passed; 0 failed; 0 ignored

Self-check

tools/pr_ready.py was not run (Windows). Commands run instead:

  • cargo fmt --all -- --check: clean
  • cargo clippy -p horizon-client-render --all-targets -- -D warnings: clean
  • cargo clippy -p horizon-client --features mods --all-targets -- -D warnings: clean
  • cargo test -p horizon-client-render --lib block_entity_render::tests: 7 passed, 1 ignored (needs prepared resources)

In game

Windows 11, cargo build --profile fast -p horizon-client --features mods: an oak sign with yellow glowing text (has_glowing_text:1b,color:"yellow") seen from 2 blocks, and a black glowing sign beside it.

  • Before (origin/main): lines 2-4 of the yellow sign break up into the dark outline, and the black sign's text is speckled the same way.
  • After: both signs read cleanly over their outlines.

🤖 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/3554 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-3293` --- ### 📝 Commits (1) - [`6bd34b6`](https://github.com/horizon-rust/horizon/commit/6bd34b64d63fbfa1fbfc66cceb9c94fdb60d1e6c) Draw glowing sign text in front of its outline ### 📊 Changes **1 file changed** (+82 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/block_entity_render.rs` (+82 -4) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Fixes #3293 (also the duplicate report #2923) Glowing sign text was hard to read: its letters flickered and broke up into the dark outline around them. `block_entity_render.rs` `draw_text` emits the eight one-pixel outline copies and the text itself on the same plane (z = 0 in text space) into the same mesh, so the text and the outline under it z-fight. Vanilla draws the outline NORMAL and the text over it with `Font.DisplayMode.POLYGON_OFFSET`, so the coplanar text always wins the depth test. Horizon draws sign text in the block-entity mesh, which has no polygon-offset pass. The fix lifts the text of an outlined call by a twentieth of a font pixel towards the reader (about 0.0005 of a block, too little to see), so it always sits in front of its outline. Text without an outline (ordinary sign text) is unchanged. ## Vanilla reference - `AbstractSignRenderer.submitSignText` submits the lines with `Font.DisplayMode.POLYGON_OFFSET` and the outline colour. - `TextFeatureRenderer.renderText` (26.3, javap): with an outline colour it prepares `Font.prepare8xTextOutline` and draws it with `displayMode = NORMAL`, then draws `Font.prepareText` with `displayMode = POLYGON_OFFSET`. ## Test New unit test `block_entity_render::tests::outlined_sign_text_sits_in_front_of_its_outline`: every vertex of an outlined call's text is in front of every outline vertex, and text without an outline stays on the sign's plane. `cargo test -p horizon-client-render --lib block_entity_render::tests::outlined_sign_text` Before (the fix reverted, test kept): ``` test block_entity_render::tests::outlined_sign_text_sits_in_front_of_its_outline ... FAILED text z [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] not in front of the outline at 0 test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 511 filtered out ``` After: ``` test block_entity_render::tests::outlined_sign_text_sits_in_front_of_its_outline ... ok test result: ok. 1 passed; 0 failed; 0 ignored ``` ## Self-check `tools/pr_ready.py` was not run (Windows). Commands run instead: - `cargo fmt --all -- --check`: clean - `cargo clippy -p horizon-client-render --all-targets -- -D warnings`: clean - `cargo clippy -p horizon-client --features mods --all-targets -- -D warnings`: clean - `cargo test -p horizon-client-render --lib block_entity_render::tests`: 7 passed, 1 ignored (needs prepared resources) ## In game Windows 11, `cargo build --profile fast -p horizon-client --features mods`: an oak sign with yellow glowing text (`has_glowing_text:1b,color:"yellow"`) seen from 2 blocks, and a black glowing sign beside it. - Before (origin/main): lines 2-4 of the yellow sign break up into the dark outline, and the black sign's text is speckled the same way. - After: both signs read cleanly over their outlines. 🤖 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:09:51 +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#5047
No description provided.