[PR #2583] [MERGED] Decorated pot: cull its back faces like entitySolid (fixes #2087) #4447

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

📋 Pull Request Information

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

Base: main ← Head: fix/pot-back-face-culling


📝 Commits (10+)

  • 408a75a Decorated pot: draw one face of its top and bottom planes
  • d338bcd Decorated pot: say why only the outer faces stay
  • 83a6f5c Revert "Decorated pot: say why only the outer faces stay"
  • 9841ce7 Revert "Decorated pot: draw one face of its top and bottom planes"
  • c987778 Decorated pot: keep every quad and cull back faces like entitySolid
  • 5ac1c82 Merge kacpherek's PR #2099: the decorated pot culls its back faces
  • ac33fb7 Add the decorated pot's back-face culling regression test
  • 7250944 Test the decorated pot item's back-face culling too
  • b7749dd Fix a needless borrow in the decorated pot's test
  • 0ee20da Merge remote-tracking branch 'upstream/main' into fix/pot-back-face-culling

📊 Changes

6 files changed (+156 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/block_entity_render.rs (+77 -1)
📝 crates/horizon-client/src/entity.wgsl (+7 -2)
📝 crates/horizon-client/src/item_render.rs (+5 -2)
📝 crates/horizon-client/src/item_render/gui.rs (+1 -0)
📝 crates/horizon-client/src/item_render/special.rs (+61 -0)
📝 crates/horizon-client/src/mesher.rs (+5 -1)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself.

What and why

The decorated pot renders wrong: placed on the ground, dropped as an item or held in the hand, its top and bottom planes show both sides and z-fight.

The pot's model (DecoratedPotRenderer.createBaseLayer) has two flat boxes, top (14×0×14 at y=16) and bottom (14×0×14 at y=0). A flat box is drawn with all six faces, so each plane carries an up-facing and a down-facing quad at the same place. Vanilla submits all of them with RenderTypes.entitySolid, whose pipeline culls back faces (RenderPipelines.ENTITY_SOLID keeps the default cull, unlike the *_NO_CULL entity pipelines, which call withCull(false)), so only one side of each plane is ever rasterised. Horizon's entity pipelines draw two-sided (cull_mode: None in gfx.rs), so both sides are drawn and they z-fight.

@kacpherek's #2099 draws that cull: the pot's quads carry a flag in the vertex (the normal's w) and entity.wgsl discards the back-facing pixels, which keeps all of vanilla's 28 submitted quads. This pull request is that fix plus the regression tests it was missing: the block-entity path and the item path each check that the pot keeps every quad vanilla submits and that every one of them is marked for the cull. Fixes #2087.

Vanilla reference

  • DecoratedPotRenderer.createBaseLayer — the pot's top and bottom are CubeListBuilder boxes with zero height, so each is drawn with an up-facing and a down-facing quad at the same place.
  • DecoratedPotRenderer.submit — every part (neck, top, bottom and the four sides) is submitted with Sheets.DECORATED_POT_BASE.renderType(RenderTypes::entitySolid); the sides use the same render type (SideSprite.create).
  • RenderTypes.entitySolid → RenderPipelines.ENTITY_SOLID — the pipeline keeps the default back-face cull, so the far side of each plane is never rasterised. The cull lives in the render type, not in the model: vanilla submits the same 28 quads Horizon does, and the difference is only which of them reach the screen.
  • ModelPart / CubeListBuilder.addBox — a box with zero height still contributes an up and a down face.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, against upstream/main at d74d39cb0, 5 min 43 s)

Check Result
Scope ✅ 6 files, +156 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 325 passed (23 s)
rustfmt ✅ (4 s)
clippy ✅ (1 min 13 s)
tests: horizon-client ✅ 1289 passed (3 min 20 s)
doc tests ✅ 0 passed (34 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 75 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 63 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
cargo test -p horizon-client --lib -- culls_its_back_faces:
running 2 tests
test item_render::special::tests::the_decorated_pot_item_culls_its_back_faces ... ok
test block_entity_render::tests::the_decorated_pot_culls_its_back_faces ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1214 filtered out; finished in 1.23s

Both tests fail without the cull (entitySolid culls the pot's back faces), and the block-entity test fails as well if the pot drops any of vanilla's 28 quads.

python3 tools/parity.py block_entity_render item_model — the parity gate @ludovic111's agent asked @kacpherek to re-run on this branch:

Running 2 harnesses, 4 at a time here...
PASS block_entity_render 118s
PASS item_model 208s

2 passed, 0 failed in 3.5 min.

cargo test -p horizon-client --lib: test result: ok. 1189 passed; 0 failed; 27 ignored; 0 measured; 0 filtered out.

🤖 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/2583 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/pot-back-face-culling` --- ### 📝 Commits (10+) - [`408a75a`](https://github.com/horizon-rust/horizon/commit/408a75aeb32f1f1e34d03f4ff9a42098fcf8514b) Decorated pot: draw one face of its top and bottom planes - [`d338bcd`](https://github.com/horizon-rust/horizon/commit/d338bcd070a6c2bf2568c1f57900bf222299929b) Decorated pot: say why only the outer faces stay - [`83a6f5c`](https://github.com/horizon-rust/horizon/commit/83a6f5c7b9b76071bc7798b63f11085d37beb61a) Revert "Decorated pot: say why only the outer faces stay" - [`9841ce7`](https://github.com/horizon-rust/horizon/commit/9841ce7824d8a65fbc66f5a2d2ecef07defd4912) Revert "Decorated pot: draw one face of its top and bottom planes" - [`c987778`](https://github.com/horizon-rust/horizon/commit/c987778e97f2290abce276333ffc22ba24f6ef78) Decorated pot: keep every quad and cull back faces like entitySolid - [`5ac1c82`](https://github.com/horizon-rust/horizon/commit/5ac1c82eb933adbc576f15498e84f66a7d047401) Merge kacpherek's PR #2099: the decorated pot culls its back faces - [`ac33fb7`](https://github.com/horizon-rust/horizon/commit/ac33fb74ece1bc40ac7c6e28fc69acfdd20ef023) Add the decorated pot's back-face culling regression test - [`7250944`](https://github.com/horizon-rust/horizon/commit/7250944a7c79b8c2371fafeb7714b9841ddf3e59) Test the decorated pot item's back-face culling too - [`b7749dd`](https://github.com/horizon-rust/horizon/commit/b7749dd0d2b87b29ca01bbf40990cbc467bc34e8) Fix a needless borrow in the decorated pot's test - [`0ee20da`](https://github.com/horizon-rust/horizon/commit/0ee20da35c3a77f5f16ac69c2ba1345c75b7ea4f) Merge remote-tracking branch 'upstream/main' into fix/pot-back-face-culling ### 📊 Changes **6 files changed** (+156 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/block_entity_render.rs` (+77 -1) 📝 `crates/horizon-client/src/entity.wgsl` (+7 -2) 📝 `crates/horizon-client/src/item_render.rs` (+5 -2) 📝 `crates/horizon-client/src/item_render/gui.rs` (+1 -0) 📝 `crates/horizon-client/src/item_render/special.rs` (+61 -0) 📝 `crates/horizon-client/src/mesher.rs` (+5 -1) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself. ## What and why The decorated pot renders wrong: placed on the ground, dropped as an item or held in the hand, its top and bottom planes show both sides and z-fight. The pot's model (`DecoratedPotRenderer.createBaseLayer`) has two flat boxes, `top` (14×0×14 at y=16) and `bottom` (14×0×14 at y=0). A flat box is drawn with all six faces, so each plane carries an up-facing and a down-facing quad at the same place. Vanilla submits all of them with `RenderTypes.entitySolid`, whose pipeline culls back faces (`RenderPipelines.ENTITY_SOLID` keeps the default cull, unlike the `*_NO_CULL` entity pipelines, which call `withCull(false)`), so only one side of each plane is ever rasterised. Horizon's entity pipelines draw two-sided (`cull_mode: None` in `gfx.rs`), so both sides are drawn and they z-fight. @kacpherek's #2099 draws that cull: the pot's quads carry a flag in the vertex (the normal's w) and `entity.wgsl` discards the back-facing pixels, which keeps all of vanilla's 28 submitted quads. This pull request is that fix plus the regression tests it was missing: the block-entity path and the item path each check that the pot keeps every quad vanilla submits and that every one of them is marked for the cull. Fixes #2087. ## Vanilla reference - `DecoratedPotRenderer.createBaseLayer` — the pot's `top` and `bottom` are `CubeListBuilder` boxes with zero height, so each is drawn with an up-facing and a down-facing quad at the same place. - `DecoratedPotRenderer.submit` — every part (`neck`, `top`, `bottom` and the four sides) is submitted with `Sheets.DECORATED_POT_BASE.renderType(RenderTypes::entitySolid)`; the sides use the same render type (`SideSprite.create`). - `RenderTypes.entitySolid` → `RenderPipelines.ENTITY_SOLID` — the pipeline keeps the default back-face cull, so the far side of each plane is never rasterised. The cull lives in the render type, not in the model: vanilla submits the same 28 quads Horizon does, and the difference is only which of them reach the screen. - `ModelPart` / `CubeListBuilder.addBox` — a box with zero height still contributes an up and a down face. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, against upstream/main at d74d39cb0, 5 min 43 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +156 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 325 passed (23 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (1 min 13 s) | | tests: horizon-client | ✅ 1289 passed (3 min 20 s) | | doc tests | ✅ 0 passed (34 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 75 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 63 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | `cargo test -p horizon-client --lib -- culls_its_back_faces`: ``` running 2 tests test item_render::special::tests::the_decorated_pot_item_culls_its_back_faces ... ok test block_entity_render::tests::the_decorated_pot_culls_its_back_faces ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1214 filtered out; finished in 1.23s ``` Both tests fail without the cull (`entitySolid culls the pot's back faces`), and the block-entity test fails as well if the pot drops any of vanilla's 28 quads. `python3 tools/parity.py block_entity_render item_model` — the parity gate @ludovic111's agent asked @kacpherek to re-run on this branch: ``` Running 2 harnesses, 4 at a time here... PASS block_entity_render 118s PASS item_model 208s 2 passed, 0 failed in 3.5 min. ``` `cargo test -p horizon-client --lib`: `test result: ok. 1189 passed; 0 failed; 27 ignored; 0 measured; 0 filtered out`. 🤖 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 04:17:13 +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#4447
No description provided.