[PR #7161] [MERGED] Draw translucent dropped items over their shadow and ice #7385

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7161
Author: @DUzzL
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/7026-slime-item-transparency


📝 Commits (2)

  • e6be1c2 Draw entity shadows before translucent items and let those items write depth
  • cf968b7 Drop the source-text test

📊 Changes

1 file changed (+24 additions, -20 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+24 -20)

📄 Description

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

Fixes #7026
Fixes #7031
Fixes #7033

What / why

Translucent item quads (dropped slime block, glass) were drawn in the classic (non-OIT) path with depth writes off, and after the entity shadows:

  • the ground shadow was drawn over the item (#7026);
  • translucent terrain drawn later (ice, water) passed the depth test where the item was and blended over it, so the item all but vanished on ice (#7031, #7033).

Changes in crates/horizon-client-render/src/gfx.rs:

  • shadows are drawn before the translucent items;
  • the translucent item pipeline writes depth.

Vanilla reference

  • FeatureRenderDispatcher.PreparedFrame.executeTranslucent: shadows phase, then ... translucentBlocksAndItems.
  • LevelRenderer.executeClassicTransparency: executeTranslucent, then translucent terrain, then executeTranslucentAfterTerrain (particles only). Items therefore sit before ice in the draw order, and vanilla shows them clearly on ice, so they must write depth. I could not read the ITEM_TRANSLUCENT depth state through REA (RenderPipelines <clinit> is folded away), so depth writing is inferred from this order plus vanilla's visible result.
  • Improved transparency (OIT) path is untouched (default off).

Verification

Fresh temp folders, offscreen game on base (nightly main 39eb8fc3c) vs this branch, horizon-ctl screenshots of items on a stone/ice/grass platform:

  • before: slime block on ice is not visible at all; glass on ice barely visible; shadow dark disc overlaps the slime block on grass.
  • after: slime block and glass on ice clearly visible; shadow lies under the slime block on grass.
  • Regression test gfx::crumbling_tests::shadows_precede_translucent_items_which_write_depth (source-order check; no GPU needed).
  • Not verified: a glass item inside deep water (view was too dark to judge; the old comment feared water behind glass items vanishing, which is the same as vanilla's classic path).

pr_ready (--quick)

Check Result
Scope 2 files, +52 -20
Cargo.lock unchanged
Public tree ok
Python tests 611 passed
rustfmt ok
clippy ok
tests: horizon-client-render failed in this Windows env: crash::tests (2), gfx::entity_skin shader test, gfx::tests::indirect_draws... (GPU/panic-hook, unrelated); new test passes
doc tests failed: shared-target build race (horizon_core::prepared_files not found in horizon-world), unrelated
Parity 93 affected, left to CI (--quick)

🔄 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/7161 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/7026-slime-item-transparency` --- ### 📝 Commits (2) - [`e6be1c2`](https://github.com/horizon-rust/horizon/commit/e6be1c259a47b06c8223594212102b765ad63b2d) Draw entity shadows before translucent items and let those items write depth - [`cf968b7`](https://github.com/horizon-rust/horizon/commit/cf968b78eb7e285770eb86873b9c6fd48824137e) Drop the source-text test ### 📊 Changes **1 file changed** (+24 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+24 -20) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself. Fixes #7026 Fixes #7031 Fixes #7033 ## What / why Translucent item quads (dropped slime block, glass) were drawn in the classic (non-OIT) path with depth writes off, and after the entity shadows: - the ground shadow was drawn over the item (#7026); - translucent terrain drawn later (ice, water) passed the depth test where the item was and blended over it, so the item all but vanished on ice (#7031, #7033). Changes in `crates/horizon-client-render/src/gfx.rs`: - shadows are drawn before the translucent items; - the translucent item pipeline writes depth. ## Vanilla reference - `FeatureRenderDispatcher.PreparedFrame.executeTranslucent`: `shadows` phase, then ... `translucentBlocksAndItems`. - `LevelRenderer.executeClassicTransparency`: `executeTranslucent`, then translucent terrain, then `executeTranslucentAfterTerrain` (particles only). Items therefore sit before ice in the draw order, and vanilla shows them clearly on ice, so they must write depth. I could not read the `ITEM_TRANSLUCENT` depth state through REA (RenderPipelines `<clinit>` is folded away), so depth writing is inferred from this order plus vanilla's visible result. - Improved transparency (OIT) path is untouched (default off). ## Verification Fresh temp folders, offscreen game on base (nightly main 39eb8fc3c) vs this branch, `horizon-ctl` screenshots of items on a stone/ice/grass platform: - before: slime block on ice is not visible at all; glass on ice barely visible; shadow dark disc overlaps the slime block on grass. - after: slime block and glass on ice clearly visible; shadow lies under the slime block on grass. - Regression test `gfx::crumbling_tests::shadows_precede_translucent_items_which_write_depth` (source-order check; no GPU needed). - Not verified: a glass item inside deep water (view was too dark to judge; the old comment feared water behind glass items vanishing, which is the same as vanilla's classic path). ## pr_ready (--quick) | Check | Result | | --- | --- | | Scope | 2 files, +52 -20 | | Cargo.lock | unchanged | | Public tree | ok | | Python tests | 611 passed | | rustfmt | ok | | clippy | ok | | tests: horizon-client-render | failed in this Windows env: crash::tests (2), gfx::entity_skin shader test, gfx::tests::indirect_draws... (GPU/panic-hook, unrelated); new test passes | | doc tests | failed: shared-target build race (`horizon_core::prepared_files` not found in horizon-world), unrelated | | Parity | 93 affected, left to CI (--quick) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:38:43 +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#7385
No description provided.