[PR #2638] [MERGED] HDR: let light sources shine the same under the vignette #4494

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2638
Author: @senjinthedragon
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: hdr-vignette


📝 Commits (1)

  • 620dfc6 HDR: let light sources shine the same under the vignette

📊 Changes

1 file changed (+9 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/hdr.wgsl (+9 -5)

📄 Description

🤖 Opened by Senjin's AI agent (Claude Code), not by Senjin.

What and why

Follows #2021, part of #1441. With the vignette on, a light source's highlights depended on where it was on
screen: a jack o'lantern's face lit up fully in the middle of the screen and only at its eyes and mouth
further out, like a flashlight following the crosshair. Two causes, both in hdr.wgsl:

  • The lift's threshold read the frame, which the vignette darkens toward the edges. It now reads the
    world copy the pass already keeps (taken before the hand and the screen effects). The gain still applies
    to the frame, so the vignette darkens highlights as before.
  • shows_world rejected vignetted pixels with a channel at 0 (a pumpkin's stem): it compared each
    channel's ratio to their mean, and a 0 channel's ratio is 0. The channels are now held to one factor,
    the ratio of their sums, with a step of 8-bit rounding allowed on each. Pixels the hand, HUD or text
    replace still fail it.

Vanilla reference

Horizon-only. HDR stays off by default; with it off nothing changes.

Self-check

pr_ready (tools/pr_ready.py --quick, against origin/main at 08492a30)

Check Result
Scope ✅ 1 file, +9 −5
rustfmt ✅
clippy ✅
tests: horizon-client ✅ 1287 passed
doc tests ✅

hdr.wgsl also parses and validates with naga (checked locally; a shader test in gfx/hdr.rs can follow
once #2292, which adds that file's test module, is in). Merges cleanly with #2292 and #2304.

Testing

Linux, KWin 6.8.1, NVIDIA RTX 2080, Alienware AW3423DW, with HORIZON_HDR_DEBUG=1:

  • Before: a jack o'lantern's top turned fully magenta in a circle around the crosshair and only partly
    outside it; with the vignette off the circle was gone, which pointed at the vignette.
  • After, vignette on: the same at the middle and at the edges of the screen, near and from 8 blocks away.

Screenshots

HDR can't be shown in an SDR screenshot.

🤖 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/2638 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hdr-vignette` --- ### 📝 Commits (1) - [`620dfc6`](https://github.com/horizon-rust/horizon/commit/620dfc6e0d53f0d32d75b791009ecbd923b92114) HDR: let light sources shine the same under the vignette ### 📊 Changes **1 file changed** (+9 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/hdr.wgsl` (+9 -5) </details> ### 📄 Description > 🤖 Opened by Senjin's AI agent (Claude Code), not by Senjin. ## What and why Follows #2021, part of #1441. With the vignette on, a light source's highlights depended on where it was on screen: a jack o'lantern's face lit up fully in the middle of the screen and only at its eyes and mouth further out, like a flashlight following the crosshair. Two causes, both in `hdr.wgsl`: - **The lift's threshold read the frame**, which the vignette darkens toward the edges. It now reads the world copy the pass already keeps (taken before the hand and the screen effects). The gain still applies to the frame, so the vignette darkens highlights as before. - **`shows_world` rejected vignetted pixels with a channel at 0** (a pumpkin's stem): it compared each channel's ratio to their mean, and a 0 channel's ratio is 0. The channels are now held to one factor, the ratio of their sums, with a step of 8-bit rounding allowed on each. Pixels the hand, HUD or text replace still fail it. ## Vanilla reference Horizon-only. HDR stays off by default; with it off nothing changes. ## Self-check **pr_ready** (`tools/pr_ready.py --quick`, against origin/main at 08492a30) | Check | Result | | --- | --- | | Scope | ✅ 1 file, +9 −5 | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client | ✅ 1287 passed | | doc tests | ✅ | `hdr.wgsl` also parses and validates with naga (checked locally; a shader test in `gfx/hdr.rs` can follow once #2292, which adds that file's test module, is in). Merges cleanly with #2292 and #2304. ## Testing Linux, KWin 6.8.1, NVIDIA RTX 2080, Alienware AW3423DW, with `HORIZON_HDR_DEBUG=1`: - Before: a jack o'lantern's top turned fully magenta in a circle around the crosshair and only partly outside it; with the vignette off the circle was gone, which pointed at the vignette. - After, vignette on: the same at the middle and at the edges of the screen, near and from 8 blocks away. ## Screenshots HDR can't be shown in an SDR screenshot. 🤖 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 04:17:34 +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#4494
No description provided.