[PR #4897] [MERGED] Improved transparency: route features, particles, weather, world border and flat draws #5927

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

📋 Pull Request Information

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

Base: main ← Head: parity/B2-oit-features


📝 Commits (3)

  • 5fbb18a Improved transparency: route features, particles, weather, border and flat draws
  • 7680fee Merge remote-tracking branch 'hr/main' into parity/B2-oit-features
  • 65d6826 Merge remote-tracking branch 'hr/main' into parity/B2-oit-features

📊 Changes

9 files changed (+582 additions, -21 deletions)

View changed files

📝 crates/horizon-client-render/src/border.wgsl (+3 -0)
📝 crates/horizon-client-render/src/entity.wgsl (+18 -2)
📝 crates/horizon-client-render/src/gfx.rs (+119 -15)
📝 crates/horizon-client-render/src/gfx/oit.rs (+116 -4)
➕ crates/horizon-client-render/src/gfx/oit_features.rs (+217 -0)
📝 crates/horizon-client-render/src/gfx/weather.rs (+20 -0)
📝 crates/horizon-client-render/src/oit.wgsl (+28 -0)
➕ crates/horizon-client-render/src/oit_border.wgsl (+13 -0)
➕ crates/horizon-client-render/src/oit_features.wgsl (+48 -0)

📄 Description

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

Part of #3519

Rows

  • LevelRenderer.executeOit: the "Features, World Border, Weather" pass now exists. With Improved transparency on, each stage (depth bounds, transmittance, accumulate) also draws what vanilla's FeatureRenderDispatcher.executeOit, WorldBorderRenderer.renderOit and WeatherEffectRenderer.renderOit draw, over the world's depth and before the cull/clouds, instead of blending it classically after the composite: translucent items (OIT_ITEM), translucent-layer particles (OIT_PARTICLE), text-display text (OIT_TEXT_POLYGON_OFFSET), breaking cracks (OIT_CRUMBLING), entity shadows (OIT_ENTITY_SHADOW), energy swirls (OIT_ENERGY_SWIRL, additive), weather (OIT_WEATHER) and the world border (OIT_WORLD_BORDER, additive).
  • Flat section draws now work with the option on (vs_terrain_flat with the same three fragments), so the option no longer turns the flat path off. Vanilla has no equivalent: flat draws are Horizon's own way to cut draw calls.

How

  • Each stage's fragment calls the classic fragment function and uses its alpha (bounds, transmittance) or weights its colour (accumulate). Weighting a fogged colour equals fogging the weighted one, since vanilla premultiplies the fog colour by the same alpha, so the colour cannot drift from the classic one. Additive kinds (swirl, border) follow OIT_ADDITIVE: bounds only, nothing in the transmittance, no coverage, fog fades them out.
  • Depth state per kind stays the classic one minus depth writes (text/crack bias, shadow bias, border polygon offset 3, crack culling).
  • With the option off nothing changes: the classic draws are only skipped under oit_on, and the classic fragments are the same code behind thin wrappers (entity_color, shadow_color, weather_color, border_color, energy_swirl_base).

Left classic

  • Translucent entity models: Horizon's entity buffer does not mark which quads came from a translucent render type, so they stay in the solid entity pass (blended, as before).
  • Lightning, eyes and other additive entities, the see-through text phase, block outline lines and debug gizmos keep their classic draws.

Vanilla followed

LevelRenderer.executeOit, SubmitNodeCollection (the improved-transparency phase assignment), FeatureRenderDispatcher.PreparedFrame.executeOit, WorldBorderRenderer.renderOit, WeatherEffectRenderer.renderOit, RenderPipelines.OIT_* and the entity, particle, rendertype_entity_shadow, rendertype_crumbling, world_border shaders' OIT_* paths.

Tests

  • gfx::oit::tests::the_feature_shaders_validate validates the new fragments (naga), and the existing WGSL validation and DX12 translation tests cover the new files.
  • Visual check (fast build, horizon-ctl --offscreen, fresh scratch homes, option off and on): a red/blue stained glass wall with water and slimes behind it shows the same scene both ways; cloud-layer particles and rain now sit correctly behind and through the glass with the option on; flat draws active (3 section draw calls) with the option on.

🤖 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/4897 **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-features` --- ### 📝 Commits (3) - [`5fbb18a`](https://github.com/horizon-rust/horizon/commit/5fbb18a139ac86df530c22946d2ec8a6a4d37cc2) Improved transparency: route features, particles, weather, border and flat draws - [`7680fee`](https://github.com/horizon-rust/horizon/commit/7680fee32572d0b631c641d3b542b5d819d2401d) Merge remote-tracking branch 'hr/main' into parity/B2-oit-features - [`65d6826`](https://github.com/horizon-rust/horizon/commit/65d68266e2ac61aa5d51a1b726c77e88c1bda43e) Merge remote-tracking branch 'hr/main' into parity/B2-oit-features ### 📊 Changes **9 files changed** (+582 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/border.wgsl` (+3 -0) 📝 `crates/horizon-client-render/src/entity.wgsl` (+18 -2) 📝 `crates/horizon-client-render/src/gfx.rs` (+119 -15) 📝 `crates/horizon-client-render/src/gfx/oit.rs` (+116 -4) ➕ `crates/horizon-client-render/src/gfx/oit_features.rs` (+217 -0) 📝 `crates/horizon-client-render/src/gfx/weather.rs` (+20 -0) 📝 `crates/horizon-client-render/src/oit.wgsl` (+28 -0) ➕ `crates/horizon-client-render/src/oit_border.wgsl` (+13 -0) ➕ `crates/horizon-client-render/src/oit_features.wgsl` (+48 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3519 ## Rows - `LevelRenderer.executeOit`: the "Features, World Border, Weather" pass now exists. With Improved transparency on, each stage (depth bounds, transmittance, accumulate) also draws what vanilla's `FeatureRenderDispatcher.executeOit`, `WorldBorderRenderer.renderOit` and `WeatherEffectRenderer.renderOit` draw, over the world's depth and before the cull/clouds, instead of blending it classically after the composite: translucent items (`OIT_ITEM`), translucent-layer particles (`OIT_PARTICLE`), text-display text (`OIT_TEXT_POLYGON_OFFSET`), breaking cracks (`OIT_CRUMBLING`), entity shadows (`OIT_ENTITY_SHADOW`), energy swirls (`OIT_ENERGY_SWIRL`, additive), weather (`OIT_WEATHER`) and the world border (`OIT_WORLD_BORDER`, additive). - Flat section draws now work with the option on (`vs_terrain_flat` with the same three fragments), so the option no longer turns the flat path off. Vanilla has no equivalent: flat draws are Horizon's own way to cut draw calls. ## How - Each stage's fragment calls the classic fragment function and uses its alpha (bounds, transmittance) or weights its colour (accumulate). Weighting a fogged colour equals fogging the weighted one, since vanilla premultiplies the fog colour by the same alpha, so the colour cannot drift from the classic one. Additive kinds (swirl, border) follow `OIT_ADDITIVE`: bounds only, nothing in the transmittance, no coverage, fog fades them out. - Depth state per kind stays the classic one minus depth writes (text/crack bias, shadow bias, border polygon offset 3, crack culling). - With the option off nothing changes: the classic draws are only skipped under `oit_on`, and the classic fragments are the same code behind thin wrappers (`entity_color`, `shadow_color`, `weather_color`, `border_color`, `energy_swirl_base`). ## Left classic - Translucent entity models: Horizon's entity buffer does not mark which quads came from a translucent render type, so they stay in the solid entity pass (blended, as before). - Lightning, eyes and other additive entities, the see-through text phase, block outline lines and debug gizmos keep their classic draws. ## Vanilla followed `LevelRenderer.executeOit`, `SubmitNodeCollection` (the improved-transparency phase assignment), `FeatureRenderDispatcher.PreparedFrame.executeOit`, `WorldBorderRenderer.renderOit`, `WeatherEffectRenderer.renderOit`, `RenderPipelines.OIT_*` and the `entity`, `particle`, `rendertype_entity_shadow`, `rendertype_crumbling`, `world_border` shaders' `OIT_*` paths. ## Tests - `gfx::oit::tests::the_feature_shaders_validate` validates the new fragments (naga), and the existing WGSL validation and DX12 translation tests cover the new files. - Visual check (fast build, `horizon-ctl --offscreen`, fresh scratch homes, option off and on): a red/blue stained glass wall with water and slimes behind it shows the same scene both ways; cloud-layer particles and rain now sit correctly behind and through the glass with the option on; flat draws active (3 section draw calls) with the option on. 🤖 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:58 +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#5927
No description provided.