[PR #5073] [MERGED] gfx: cull back faces of entity shadows #6043

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5073
Author: @mulareal
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix-entity-shadow-cull-4965


📝 Commits (1)

  • 6988570 gfx: cull back faces of entity shadows

📊 Changes

3 files changed (+15 additions, -4 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+4 -3)
📝 crates/horizon-client-render/src/gfx/oit_features.rs (+6 -1)
📝 crates/horizon-client/src/shadows.rs (+5 -0)

📄 Description

🤖 Opened by mulareal's AI agent (Antigravity, Gemini), not by mulareal personally.

What

  • Entity shadows are no longer visible from below when looking upward through terrain in Spectator Mode.
  • Fixes #4965

Why

  • RenderPipelines.ENTITY_SHADOW and RenderPipelines.OIT_ENTITY_SHADOW inherit RenderPipeline.Builder.build's default cull = true in vanilla, culling the underside of the upward-facing (+Y) shadow quads emitted by ShadowFeatureRenderer.prepare.
  • Renderer::new (shadow_blob_pipeline) and Features::new (shadow) passed cull_mode: None, so the back faces of shadow quads were drawn when viewed from underground while the terrain surface above was back-face culled.

Fix

  • Enable Some(wgpu::Face::Back) on shadow_blob_pipeline in Renderer::new (crates/horizon-client-render/src/gfx.rs).
  • Enable Some(wgpu::Face::Back) on Features::shadow in Features::new (crates/horizon-client-render/src/gfx/oit_features.rs).
  • Assert upward (+Y) quad winding in shadows_lie_on_the_block_top_under_model_feet (crates/horizon-client/src/shadows.rs).

Checked

  • Ran cargo test -p horizon-client --lib -- shadows::tests against the prepared 26.3 resources (7 passed).
  • Ran cargo test -p horizon-client-render --lib --bins --tests, cargo test -p horizon-client --lib --bins --tests, cargo clippy -p horizon-client-render -p horizon-client --bins --tests -- -D warnings, cargo fmt --all -- --check, and python tools/check_public_tree.py.
Check Result
Scope ✅ 3 files, +15 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 484 passed
rustfmt ✅
clippy (horizon-client-render, horizon-client) ✅
tests: horizon-client-render ✅ 704 passed
tests: horizon-client ✅ 1337 passed
doc tests ✅ 0 passed
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 (--quick): CI's parity job picks the affected harnesses

🤖 Generated with Antigravity


🔄 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/5073 **Author:** [@mulareal](https://github.com/mulareal) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix-entity-shadow-cull-4965` --- ### 📝 Commits (1) - [`6988570`](https://github.com/horizon-rust/horizon/commit/6988570a3713b3992721515ac9c3c67be0346e9a) gfx: cull back faces of entity shadows ### 📊 Changes **3 files changed** (+15 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+4 -3) 📝 `crates/horizon-client-render/src/gfx/oit_features.rs` (+6 -1) 📝 `crates/horizon-client/src/shadows.rs` (+5 -0) </details> ### 📄 Description > 🤖 Opened by mulareal's AI agent (Antigravity, Gemini), not by mulareal personally. ## What - Entity shadows are no longer visible from below when looking upward through terrain in Spectator Mode. - Fixes #4965 ## Why - `RenderPipelines.ENTITY_SHADOW` and `RenderPipelines.OIT_ENTITY_SHADOW` inherit `RenderPipeline.Builder.build`'s default `cull = true` in vanilla, culling the underside of the upward-facing (`+Y`) shadow quads emitted by `ShadowFeatureRenderer.prepare`. - `Renderer::new` (`shadow_blob_pipeline`) and `Features::new` (`shadow`) passed `cull_mode: None`, so the back faces of shadow quads were drawn when viewed from underground while the terrain surface above was back-face culled. ## Fix - Enable `Some(wgpu::Face::Back)` on `shadow_blob_pipeline` in `Renderer::new` (`crates/horizon-client-render/src/gfx.rs`). - Enable `Some(wgpu::Face::Back)` on `Features::shadow` in `Features::new` (`crates/horizon-client-render/src/gfx/oit_features.rs`). - Assert upward (`+Y`) quad winding in `shadows_lie_on_the_block_top_under_model_feet` (`crates/horizon-client/src/shadows.rs`). ## Checked - Ran `cargo test -p horizon-client --lib -- shadows::tests` against the prepared 26.3 resources (`7 passed`). - Ran `cargo test -p horizon-client-render --lib --bins --tests`, `cargo test -p horizon-client --lib --bins --tests`, `cargo clippy -p horizon-client-render -p horizon-client --bins --tests -- -D warnings`, `cargo fmt --all -- --check`, and `python tools/check_public_tree.py`. | Check | Result | |---|---| | Scope | ✅ 3 files, +15 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 484 passed | | rustfmt | ✅ | | clippy (`horizon-client-render`, `horizon-client`) | ✅ | | tests: horizon-client-render | ✅ 704 passed | | tests: horizon-client | ✅ 1337 passed | | doc tests | ✅ 0 passed | | 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 (--quick): CI's parity job picks the affected harnesses | 🤖 Generated with [Antigravity](https://antigravity.google) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16: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#6043
No description provided.