[PR #5610] [MERGED] Text displays: cull their back faces, like vanilla's text pipelines #6388

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

📋 Pull Request Information

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

Base: main ← Head: fix/3833-text-display-backface-cull


📝 Commits (1)

  • eba43f7 Text displays: cull their back faces, like vanilla's text pipelines

📊 Changes

4 files changed (+99 additions, -6 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+8 -4)
📝 crates/horizon-client-render/src/gfx/oit_features.rs (+1 -1)
📝 crates/horizon-client/src/game/text_displays.rs (+1 -1)
📝 crates/horizon-client/src/text_display.rs (+89 -0)

📄 Description

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

Text displays showed their text from behind, mirrored (#3833). This PR culls their back faces, as vanilla does. It replaces #3849, which was closed as stale, and fixes the problem that PR missed.

What changed

  • Culling (gfx.rs, gfx/oit_features.rs): the see-through and polygon-offset text pipelines now cull back faces (Some(Face::Back)), and so does the improved-transparency text pipeline. In vanilla 26.3, RenderPipelines.TEXT_POLYGON_OFFSET, TEXT_SEE_THROUGH and the TEXT_SNIPPET / WORLD_TEXT_SNIPPET they build on never call withCull, so RenderPipeline.Builder.build falls back to cull.orElse(true). Horizon drew them with cull_mode: None.
  • Winding (text_display.rs, game/text_displays.rs): culling alone, as in #3849, would have hidden the side the text reads from. The text display quads took their corners from the HudBatch quad as [0, 1, 2, 5], which winds clockwise toward the reader. They now go through text_display::CORNERS = [5, 2, 1, 0]: vanilla Font's glyph order (top left, bottom left, bottom right, top right), which name tags already use.

Other world text

  • Name tags (names.rs::name_tag_quads) already push [5, 2, 1, 0], so their faded see-through copy keeps facing the camera. Their normal draw goes through the entity pipeline and is unchanged.
  • Test-instance markers go through name_tag_quads, so the same holds for them.
  • Signs don't draw through these pipelines.

Tests

  • New test text_display::tests::text_quads_face_the_side_they_read_from. It projects the quads through camera::view_matrix and the game's reversed-z perspective_rh, then checks that the side the text reads from (left to right) is the counter-clockwise one. Cases:

    • fixed displays at yaw 0 and 90, from the front and from behind;
    • a mirrored scale ([-1, 1, 1]);
    • billboard modes vertical, horizontal and center at five camera yaws.

    With the old corner order the test fails ([false, true]).

  • In game: server thread, --offscreen with horizon-ctl and scratch homes. The scene has a fixed display, a fixed see_through display, a center billboard and an armor stand's name tag behind a stone wall.

    • From the front: all four read correctly.
    • From behind: both fixed displays are gone, while the billboard and the name tag still face the camera.
    • Through the wall: the name tag's faded copy shows.
  • cargo test -p horizon-client --lib text_display: 7 passed.

  • cargo test -p horizon-client-render --lib: 812 passed.

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at c9d8e3efa, 8 min 19 s)

Check Result
Scope ✅ 5 files, +99 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 510 passed (42 s)
rustfmt ✅ (9 s)
clippy ✅ (1 min 20 s)
tests: horizon-client, horizon-client-render ✅ 2396 passed (6 min 0 s)
doc tests ✅ 0 passed (5 s)
Parity ➖ 365 affected, to run in CI (--quick)

Fixes #3833

🤖 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/5610 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/3833-text-display-backface-cull` --- ### 📝 Commits (1) - [`eba43f7`](https://github.com/horizon-rust/horizon/commit/eba43f7fc9ccb94a56e639074d6afec8bdacb819) Text displays: cull their back faces, like vanilla's text pipelines ### 📊 Changes **4 files changed** (+99 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+8 -4) 📝 `crates/horizon-client-render/src/gfx/oit_features.rs` (+1 -1) 📝 `crates/horizon-client/src/game/text_displays.rs` (+1 -1) 📝 `crates/horizon-client/src/text_display.rs` (+89 -0) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally. Text displays showed their text from behind, mirrored (#3833). This PR culls their back faces, as vanilla does. It replaces #3849, which was closed as stale, and fixes the problem that PR missed. ## What changed - **Culling** (`gfx.rs`, `gfx/oit_features.rs`): the see-through and polygon-offset text pipelines now cull back faces (`Some(Face::Back)`), and so does the improved-transparency text pipeline. In vanilla 26.3, `RenderPipelines.TEXT_POLYGON_OFFSET`, `TEXT_SEE_THROUGH` and the `TEXT_SNIPPET` / `WORLD_TEXT_SNIPPET` they build on never call `withCull`, so `RenderPipeline.Builder.build` falls back to `cull.orElse(true)`. Horizon drew them with `cull_mode: None`. - **Winding** (`text_display.rs`, `game/text_displays.rs`): culling alone, as in #3849, would have hidden the side the text reads from. The text display quads took their corners from the `HudBatch` quad as `[0, 1, 2, 5]`, which winds clockwise toward the reader. They now go through `text_display::CORNERS = [5, 2, 1, 0]`: vanilla `Font`'s glyph order (top left, bottom left, bottom right, top right), which name tags already use. ## Other world text - **Name tags** (`names.rs::name_tag_quads`) already push `[5, 2, 1, 0]`, so their faded see-through copy keeps facing the camera. Their normal draw goes through the entity pipeline and is unchanged. - **Test-instance markers** go through `name_tag_quads`, so the same holds for them. - **Signs** don't draw through these pipelines. ## Tests - New test `text_display::tests::text_quads_face_the_side_they_read_from`. It projects the quads through `camera::view_matrix` and the game's reversed-z `perspective_rh`, then checks that the side the text reads from (left to right) is the counter-clockwise one. Cases: - fixed displays at yaw 0 and 90, from the front and from behind; - a mirrored scale (`[-1, 1, 1]`); - billboard modes vertical, horizontal and center at five camera yaws. With the old corner order the test fails (`[false, true]`). - **In game:** server thread, `--offscreen` with `horizon-ctl` and scratch homes. The scene has a fixed display, a fixed `see_through` display, a center billboard and an armor stand's name tag behind a stone wall. - From the front: all four read correctly. - From behind: both fixed displays are gone, while the billboard and the name tag still face the camera. - Through the wall: the name tag's faded copy shows. - `cargo test -p horizon-client --lib text_display`: 7 passed. - `cargo test -p horizon-client-render --lib`: 812 passed. **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at c9d8e3efa, 8 min 19 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +99 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 510 passed (42 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (1 min 20 s) | | tests: horizon-client, horizon-client-render | ✅ 2396 passed (6 min 0 s) | | doc tests | ✅ 0 passed (5 s) | | Parity | ➖ 365 affected, to run in CI (--quick) | Fixes #3833 🤖 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 06:19: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#6388
No description provided.