[PR #1691] [MERGED] Draw translucent particles after translucent terrain #3691

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1691
Author: @socksprox
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/translucent-particles


📝 Commits (2)

  • 4032e16 Draw translucent particles after translucent terrain
  • be378bb Particles: vault connections are translucent, shadows keep their range

📊 Changes

7 files changed (+130 additions, -30 deletions)

View changed files

📝 crates/horizon-client/examples/probe/marker_particles_probe.rs (+1 -1)
📝 crates/horizon-client/examples/probe/particle_providers_probe.rs (+1 -1)
📝 crates/horizon-client/src/game.rs (+5 -1)
📝 crates/horizon-client/src/gfx.rs (+36 -9)
📝 crates/horizon-client/src/gfx/entity_batch.rs (+10 -5)
📝 crates/horizon-client/src/hud.rs (+14 -1)
📝 crates/horizon-client/src/particles.rs (+63 -12)

📄 Description

🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself.

Summary

  • Quad particles all rendered in the entity batch before translucent terrain with depth writes on: a stained-glass break crumb wrote its depth, and the sorted translucent pass then culled the glass behind it — the wall appeared to vanish where crumbs were. Fixes #1679.
  • Mirrors vanilla 26.3: SubmitNodeCollection.submitQuadParticleGroup sends opaque particle layers to the solid phase and translucent layers to an afterTerrain phase drawn right after the translucent section pass (LevelRenderer.executeTranslucentAfterTerrain). Vanilla's translucent particle pipeline still writes depth, so ordering — not masking depth — is what matters.
  • HudAtlas now records sprites with a 0 < alpha < 255 texel (SpriteContents.transparency().hasTranslucent), and particles pick their layer the way SingleQuadParticle.getLayer does: the type's hardcoded layer, or Layer.bySprite for terrain, item and block-marker sprites.
  • The entity batch gains a sixth material bucket (TRANSLUCENT_PARTICLE_OVERLAY = 15) drawn immediately after the translucent section draw.

Test plan

  • cargo test -p horizon-client --lib --bins --tests — all pass, including the new layer-15 case in special_material_batches_preserve_quad_order_and_offsets and the batching equivalence test
  • In-game: filled a red stained-glass wall in front of a blue one, spawned minecraft:block red-glass crumbs between the camera and the wall, and screenshotted — the wall stays rendered behind the translucent crumbs instead of being cut out to the sky
  • tools/pr_ready.py — public tree passed; the parity harness run is still in progress locally (279 harnesses cover the touched files), the result will be posted as a comment; CI's parity job covers it as well

🤖 Generated with Devin


🔄 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/1691 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/translucent-particles` --- ### 📝 Commits (2) - [`4032e16`](https://github.com/horizon-rust/horizon/commit/4032e162ce1cb2c3552edda9a744d910383db287) Draw translucent particles after translucent terrain - [`be378bb`](https://github.com/horizon-rust/horizon/commit/be378bb77361b611b9451f76033daf97e0c8d75e) Particles: vault connections are translucent, shadows keep their range ### 📊 Changes **7 files changed** (+130 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/marker_particles_probe.rs` (+1 -1) 📝 `crates/horizon-client/examples/probe/particle_providers_probe.rs` (+1 -1) 📝 `crates/horizon-client/src/game.rs` (+5 -1) 📝 `crates/horizon-client/src/gfx.rs` (+36 -9) 📝 `crates/horizon-client/src/gfx/entity_batch.rs` (+10 -5) 📝 `crates/horizon-client/src/hud.rs` (+14 -1) 📝 `crates/horizon-client/src/particles.rs` (+63 -12) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself. ## Summary - Quad particles all rendered in the entity batch before translucent terrain with depth writes on: a stained-glass break crumb wrote its depth, and the sorted translucent pass then culled the glass behind it — the wall appeared to vanish where crumbs were. Fixes #1679. - Mirrors vanilla 26.3: `SubmitNodeCollection.submitQuadParticleGroup` sends opaque particle layers to the solid phase and translucent layers to an `afterTerrain` phase drawn right after the translucent section pass (`LevelRenderer.executeTranslucentAfterTerrain`). Vanilla's translucent particle pipeline still writes depth, so ordering — not masking depth — is what matters. - `HudAtlas` now records sprites with a 0 < alpha < 255 texel (`SpriteContents.transparency().hasTranslucent`), and particles pick their layer the way `SingleQuadParticle.getLayer` does: the type's hardcoded layer, or `Layer.bySprite` for terrain, item and block-marker sprites. - The entity batch gains a sixth material bucket (`TRANSLUCENT_PARTICLE_OVERLAY = 15`) drawn immediately after the translucent section draw. #### Test plan - [x] `cargo test -p horizon-client --lib --bins --tests` — all pass, including the new layer-15 case in `special_material_batches_preserve_quad_order_and_offsets` and the batching equivalence test - [x] In-game: filled a red stained-glass wall in front of a blue one, spawned `minecraft:block` red-glass crumbs between the camera and the wall, and screenshotted — the wall stays rendered behind the translucent crumbs instead of being cut out to the sky - [ ] `tools/pr_ready.py` — public tree passed; the parity harness run is still in progress locally (279 harnesses cover the touched files), the result will be posted as a comment; CI's parity job covers it as well 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:28 +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#3691
No description provided.