[PR #5628] [MERGED] Item quads: cull back faces like vanilla's item render types #6399

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

📋 Pull Request Information

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

Base: main ← Head: fix/held-block-item-culling


📝 Commits (1)

  • 58a1419 Item quads: cull back faces like vanilla's item render types

📊 Changes

1 file changed (+8 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/item_render.rs (+8 -5)

📄 Description

🤖 Opened by JustKarkat's AI agent (ZCode, deepseek-v4.1-flash), not by JustKarkat personally.

Fixes #4856. The same change fixes #4855 (held big dripleaf) and #4801 (held hay block): all three are two-sided item models drawn without back-face culling.

What and why

item_render::submit_quads marked a quad cull_back only when its sprite has translucent pixels, so every opaque or cutout item quad was drawn from both sides. A two-sided model already carries a quad per direction — the calibrated sculk sensor's tendrils are two coplanar quads at z=3 and z=13, its amethyst is two at x=8 and z=8 — so drawing both sides striped them; a held hay block showed its far faces through the near ones.

Every quad of a cuboid item layer now culls back faces (cull_back: true), which entity.wgsl turns into a front_facing discard exactly as it already does for entitySolid models (#5541).

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

ItemBlockRenderTypes.getRenderType(ItemStack, boolean) picks Sheets.solidBlockSheet() (RenderType.entitySolid), Sheets.cutoutBlockSheet() (RenderType.entityCutout) or Sheets.translucentItemSheet() (RenderType.entityTranslucentCull) for a block item, and all three keep the composite state's default CULL. Two-sidedness in vanilla is geometry, not culling: ItemModelGenerator.bakeExtrudedSprite bakes a South and a North quad per layer (mirrored in crates/horizon-assets/src/item_bake.rs), and block/cross and block/calibrated_sculk_sensor carry both directions themselves.

Harness: none covers held-item draw state. Verified with the offscreen client (horizon-ctl give / select / screenshot) on one sky platform at noon, yaw 0 pitch -50, before and after the change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py on cachy-josh-pc, against origin/main at 74698584e, 4 min 5 s)

Check Result
Scope ✅ 1 files, +8 −5
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 510 passed (39 s)
rustfmt ✅ (9 s)
clippy ✅ (1 min 40 s)
tests: horizon-client ✅ 1577 passed (1 min 35 s)
doc tests ✅ 0 passed (2 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 ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Screenshots

Before (culling off) over after (culling on), same platform, pose and time:

Calibrated sculk sensor — the coplanar tendril/amethyst pair striped the mauve over the block; after, one clean crystal.

sculk sensor before and after

Hay block — the far faces bled through the top; after, a solid cube.

hay block before and after

Big dripleaf — striped fringe along the leaf; after, clean.

big dripleaf before and after

Regression sweep (apple, iron sword, glass, slime block — flat extruded layers, translucent block): nothing lost.

flat and translucent items still render

🤖 Generated with ZCode (deepseek-v4.1-flash)


🔄 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/5628 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/held-block-item-culling` --- ### 📝 Commits (1) - [`58a1419`](https://github.com/horizon-rust/horizon/commit/58a141917f5fe0311270ee3859d8ca9cf3b2d7b9) Item quads: cull back faces like vanilla's item render types ### 📊 Changes **1 file changed** (+8 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/item_render.rs` (+8 -5) </details> ### 📄 Description > 🤖 Opened by JustKarkat's AI agent (ZCode, deepseek-v4.1-flash), not by JustKarkat personally. Fixes #4856. The same change fixes #4855 (held big dripleaf) and #4801 (held hay block): all three are two-sided item models drawn without back-face culling. ## What and why `item_render::submit_quads` marked a quad `cull_back` only when its sprite has translucent pixels, so every opaque or cutout item quad was drawn from both sides. A two-sided model already carries a quad per direction — the calibrated sculk sensor's tendrils are two coplanar quads at z=3 and z=13, its amethyst is two at x=8 and z=8 — so drawing both sides striped them; a held hay block showed its far faces through the near ones. Every quad of a cuboid item layer now culls back faces (`cull_back: true`), which `entity.wgsl` turns into a `front_facing` discard exactly as it already does for `entitySolid` models (#5541). ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `ItemBlockRenderTypes.getRenderType(ItemStack, boolean)` picks `Sheets.solidBlockSheet()` (`RenderType.entitySolid`), `Sheets.cutoutBlockSheet()` (`RenderType.entityCutout`) or `Sheets.translucentItemSheet()` (`RenderType.entityTranslucentCull`) for a block item, and all three keep the composite state's default `CULL`. Two-sidedness in vanilla is geometry, not culling: `ItemModelGenerator.bakeExtrudedSprite` bakes a `South` and a `North` quad per layer (mirrored in `crates/horizon-assets/src/item_bake.rs`), and `block/cross` and `block/calibrated_sculk_sensor` carry both directions themselves. Harness: none covers held-item draw state. Verified with the offscreen client (`horizon-ctl give` / `select` / `screenshot`) on one sky platform at noon, yaw 0 pitch -50, before and after the change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py` on cachy-josh-pc, against origin/main at 74698584e, 4 min 5 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +8 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 510 passed (39 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (1 min 40 s) | | tests: horizon-client | ✅ 1577 passed (1 min 35 s) | | doc tests | ✅ 0 passed (2 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 | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Screenshots Before (culling off) over after (culling on), same platform, pose and time: **Calibrated sculk sensor** — the coplanar tendril/amethyst pair striped the mauve over the block; after, one clean crystal. ![sculk sensor before and after](https://raw.githubusercontent.com/JustKarkat/horizon/screenshots/4856/pair-sculk.png) **Hay block** — the far faces bled through the top; after, a solid cube. ![hay block before and after](https://raw.githubusercontent.com/JustKarkat/horizon/screenshots/4856/pair-hay.png) **Big dripleaf** — striped fringe along the leaf; after, clean. ![big dripleaf before and after](https://raw.githubusercontent.com/JustKarkat/horizon/screenshots/4856/pair-dripleaf.png) Regression sweep (apple, iron sword, glass, slime block — flat extruded layers, translucent block): nothing lost. ![flat and translucent items still render](https://raw.githubusercontent.com/JustKarkat/horizon/screenshots/4856/regress-sheet.png) 🤖 Generated with ZCode (deepseek-v4.1-flash) --- <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: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#6399
No description provided.