[PR #4883] [MERGED] Improved transparency: water mask and cloud passes #5916

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

📋 Pull Request Information

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

Base: main ← Head: parity/B2-oit


📝 Commits (3)

  • 0e515db Improved transparency: water mask and cloud passes
  • ee837e8 Merge parity/B1-oit into parity/B2-oit
  • c8a8bf3 Merge hr/main into parity/B2-oit

📊 Changes

6 files changed (+502 additions, -140 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+80 -15)
📝 crates/horizon-client-render/src/gfx/oit.rs (+336 -68)
📝 crates/horizon-client-render/src/gfx/world_post.rs (+1 -1)
📝 crates/horizon-client-render/src/oit.wgsl (+0 -56)
➕ crates/horizon-client-render/src/oit_clouds.wgsl (+28 -0)
➕ crates/horizon-client-render/src/oit_world.wgsl (+57 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3519

Follows #4850 (the terrain OIT pass). Option off: unchanged.

Rows done:

  • LevelRenderer.executeOitWaterMask: with the option on, the boats' water patches are no longer drawn into the world depth. A copy of the world depth (terrain_depth) gets the masks and is what the terrain's three stages test against; after the depth-bounds cull changes the world depth, it is copied and masked again, as vanilla does.
  • CloudRenderer.renderOit: clouds go through the same three stages instead of the classic blend. Their bounds join the culled bounds; the depth bounds stage copies the world depth into a cloud depth buffer and writes it, so the later stages keep each pixel's nearest cloud face. Clouds are visible through glass and water now, as in vanilla (classic depth-writes hid them). Fragment colour as clouds.fsh: alpha fades toward the cloud fog end in all but the bounds stage.
  • LevelRenderer.executeOit (rest): the water mask and cloud draws join the stage loop in vanilla's order. Entities, particles, weather and the world border still draw with classic blending after the composite (not ported).

Also: world depth textures gain COPY_SRC; shader file split into oit.wgsl (shared maths), oit_world.wgsl, oit_clouds.wgsl; the HLSL translation test builds each with its base file.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

LevelRenderer.executeOitWaterMask, executeOit, CloudRenderer.renderOit, RenderPipelines.OIT_CLOUDS, OIT_WATER_MASK, BLIT_DEPTH_DURING_DEPTH_BOUNDS, clouds.fsh.

Self-check

fmt, clippy -p horizon-client-render --all-targets -D warnings, test -p horizon-client-render --lib (new naga tests validate the terrain and cloud shader sets; the HLSL translation test covers them), Windows target check. Checked in the game (offscreen) with stained glass, water, an oak boat and clouds behind the glass: option off is the classic output; on shows the clouds through the glass, the boat and water as before, no validation errors.

🤖 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/4883 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/B2-oit` --- ### 📝 Commits (3) - [`0e515db`](https://github.com/horizon-rust/horizon/commit/0e515dbfd391490c3766a9dc7658eca965b642bf) Improved transparency: water mask and cloud passes - [`ee837e8`](https://github.com/horizon-rust/horizon/commit/ee837e88bed2645fbe1a36d0d2f4c3799827e54e) Merge parity/B1-oit into parity/B2-oit - [`c8a8bf3`](https://github.com/horizon-rust/horizon/commit/c8a8bf357b2581aac5c7a81dd802267a785f5395) Merge hr/main into parity/B2-oit ### 📊 Changes **6 files changed** (+502 additions, -140 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+80 -15) 📝 `crates/horizon-client-render/src/gfx/oit.rs` (+336 -68) 📝 `crates/horizon-client-render/src/gfx/world_post.rs` (+1 -1) 📝 `crates/horizon-client-render/src/oit.wgsl` (+0 -56) ➕ `crates/horizon-client-render/src/oit_clouds.wgsl` (+28 -0) ➕ `crates/horizon-client-render/src/oit_world.wgsl` (+57 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3519 Follows #4850 (the terrain OIT pass). Option off: unchanged. Rows done: - `LevelRenderer.executeOitWaterMask`: with the option on, the boats' water patches are no longer drawn into the world depth. A copy of the world depth (`terrain_depth`) gets the masks and is what the terrain's three stages test against; after the depth-bounds cull changes the world depth, it is copied and masked again, as vanilla does. - `CloudRenderer.renderOit`: clouds go through the same three stages instead of the classic blend. Their bounds join the culled bounds; the depth bounds stage copies the world depth into a cloud depth buffer and writes it, so the later stages keep each pixel's nearest cloud face. Clouds are visible through glass and water now, as in vanilla (classic depth-writes hid them). Fragment colour as `clouds.fsh`: alpha fades toward the cloud fog end in all but the bounds stage. - `LevelRenderer.executeOit` (rest): the water mask and cloud draws join the stage loop in vanilla's order. Entities, particles, weather and the world border still draw with classic blending after the composite (not ported). Also: world depth textures gain `COPY_SRC`; shader file split into `oit.wgsl` (shared maths), `oit_world.wgsl`, `oit_clouds.wgsl`; the HLSL translation test builds each with its base file. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `LevelRenderer.executeOitWaterMask`, `executeOit`, `CloudRenderer.renderOit`, `RenderPipelines.OIT_CLOUDS`, `OIT_WATER_MASK`, `BLIT_DEPTH_DURING_DEPTH_BOUNDS`, `clouds.fsh`. ## Self-check fmt, `clippy -p horizon-client-render --all-targets -D warnings`, `test -p horizon-client-render --lib` (new naga tests validate the terrain and cloud shader sets; the HLSL translation test covers them), Windows target check. Checked in the game (offscreen) with stained glass, water, an oak boat and clouds behind the glass: option off is the classic output; on shows the clouds through the glass, the boat and water as before, no validation errors. 🤖 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 05:15:54 +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#5916
No description provided.