[PR #47] [MERGED] Fix vanilla block highlight width and depth separation #2295

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/47
Author: @Online5277
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @ludovic111

Base: main ← Head: fix/vanilla-block-highlight


📝 Commits (1)

  • 5ea60fb fix(client): match vanilla block selection outline width and depth

📊 Changes

2 files changed (+102 additions, -34 deletions)

View changed files

📝 crates/horizon-client/src/gfx.rs (+71 -30)
📝 crates/horizon-client/src/terrain.wgsl (+31 -4)

📄 Description

Summary

Fix the normal block-selection highlight being too thin and lacking vanilla depth separation. This PR is based directly on upstream main and is independent of #42; it contains only the highlight change.

Changes

  • Replace one-pixel hardware LineList rendering with an instanced, screen-space triangle strip per edge.
  • Match Window.getAppropriateLineWidth: max(2.5, framebufferWidth / 1920 * 2.5) pixels (2.5 minimum, 5 at 4K).
  • Match the perspective layering scale 1 - 1/4096 and line shader view shrink 1 - 1/256.
  • Remove the guessed 0.002 endpoint extension. Vanilla 26.3 keeps the shape edges unchanged; the slight separation is camera-space depth layering, not bounding-box inflation.
  • Preserve normal black/40%-alpha outline colour and apply the existing fog calculation as the vanilla line fragment shader does.
  • Add three regression tests for pixel-width scaling, perspective layering parameters and unchanged camera-relative shape endpoints.

Only gfx.rs and terrain.wgsl change. No new dependencies, game-derived artifacts or personal settings are included.

Validation

On this standalone main-based branch:

  • Offline contribution gate passed: public-tree check, Rust formatting, workspace Clippy, Rust tests, doctests and Python tests.
  • GPU comparison against the owned, shipped vanilla GLSL vertex shader: 768 line segments / 3,072 vertices across six framebuffer sizes, varied projections/view rotations and edge lengths. The reference executes the actual GLSL through OpenGL transform feedback; the candidate executes the actual Horizon outline_clip WGSL through Vulkan compute and uses the outline parameters from this branch.
  • Maximum clip-coordinate error: 3.8147e-6. Maximum projected screen-position difference: 0.0036621 pixels.
  • The same shader comparison passed three consecutive runs during development and was rerun against this isolated branch.
  • Standalone fast client build and offscreen Vulkan smoke checks on GTX 1660 SUPER: stone, bottom slab and closed bottom trapdoor; screenshots inspected. Clean exit.
  • The width and endpoint regression tests were observed failing before the fix.

The shader GPU comparison and owned resources/screenshots remain in ignored local research files, not the public tree. The committed regression tests run without game resources.

Scope

Normal selection outlines only. High-contrast mode, complete framebuffer/fragment-fog parity, transparency ordering, other GPUs/platforms and the full parity audit were not validated.

Integration note

This changes the shared renderer globals and line pipeline in gfx.rs; #42 also touches that file. If both land, keep the Rust/WGSL uniform field ordering consistent when resolving overlapping hunks. No #42 code is included here.


🔄 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/47 **Author:** [@Online5277](https://github.com/Online5277) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/vanilla-block-highlight` --- ### 📝 Commits (1) - [`5ea60fb`](https://github.com/horizon-rust/horizon/commit/5ea60fbd8d750c2116a2ec37406e712c6450bc2d) fix(client): match vanilla block selection outline width and depth ### 📊 Changes **2 files changed** (+102 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/gfx.rs` (+71 -30) 📝 `crates/horizon-client/src/terrain.wgsl` (+31 -4) </details> ### 📄 Description ## Summary Fix the normal block-selection highlight being too thin and lacking vanilla depth separation. This PR is based directly on upstream main and is independent of #42; it contains only the highlight change. ## Changes - Replace one-pixel hardware `LineList` rendering with an instanced, screen-space triangle strip per edge. - Match `Window.getAppropriateLineWidth`: `max(2.5, framebufferWidth / 1920 * 2.5)` pixels (2.5 minimum, 5 at 4K). - Match the perspective layering scale `1 - 1/4096` and line shader view shrink `1 - 1/256`. - Remove the guessed `0.002` endpoint extension. Vanilla 26.3 keeps the shape edges unchanged; the slight separation is camera-space depth layering, not bounding-box inflation. - Preserve normal black/40%-alpha outline colour and apply the existing fog calculation as the vanilla line fragment shader does. - Add three regression tests for pixel-width scaling, perspective layering parameters and unchanged camera-relative shape endpoints. Only `gfx.rs` and `terrain.wgsl` change. No new dependencies, game-derived artifacts or personal settings are included. ## Validation On this standalone main-based branch: - Offline contribution gate passed: public-tree check, Rust formatting, workspace Clippy, Rust tests, doctests and Python tests. - GPU comparison against the owned, shipped vanilla GLSL vertex shader: 768 line segments / 3,072 vertices across six framebuffer sizes, varied projections/view rotations and edge lengths. The reference executes the actual GLSL through OpenGL transform feedback; the candidate executes the actual Horizon `outline_clip` WGSL through Vulkan compute and uses the outline parameters from this branch. - Maximum clip-coordinate error: 3.8147e-6. Maximum projected screen-position difference: 0.0036621 pixels. - The same shader comparison passed three consecutive runs during development and was rerun against this isolated branch. - Standalone fast client build and offscreen Vulkan smoke checks on GTX 1660 SUPER: stone, bottom slab and closed bottom trapdoor; screenshots inspected. Clean exit. - The width and endpoint regression tests were observed failing before the fix. The shader GPU comparison and owned resources/screenshots remain in ignored local research files, not the public tree. The committed regression tests run without game resources. ## Scope Normal selection outlines only. High-contrast mode, complete framebuffer/fragment-fog parity, transparency ordering, other GPUs/platforms and the full parity audit were not validated. ## Integration note This changes the shared renderer globals and line pipeline in `gfx.rs`; #42 also touches that file. If both land, keep the Rust/WGSL uniform field ordering consistent when resolving overlapping hunks. No #42 code is included here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:54:41 +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#2295
No description provided.