[PR #3145] [MERGED] HDR: a black level setting, for displays whose black isn't 0 #4821

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3145
Author: @senjinthedragon
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: hdr-black


📝 Commits (4)

  • 5479b03 HDR: a black level setting, for displays whose black isn't 0
  • fb0454d Merge remote-tracking branch 'origin/main' into hdr-black
  • 5134f84 Merge remote-tracking branch 'origin/main' into hdr-black
  • b19d865 Merge main into hdr-black: settings now also save taa and upscaling

📊 Changes

8 files changed (+70 additions, -15 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+12 -4)
📝 crates/horizon-client-render/src/gfx/hdr.rs (+4 -1)
📝 crates/horizon-client-render/src/graphics.rs (+8 -1)
📝 crates/horizon-client-render/src/graphics_ui.rs (+15 -3)
📝 crates/horizon-client-render/src/hdr.wgsl (+24 -1)
📝 crates/horizon-client/src/game/options.rs (+1 -0)
📝 crates/horizon-hdr/src/lib.rs (+5 -4)
📝 docs/graphics.md (+1 -1)

📄 Description

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

What and why

Follows #2021, part of #1441. HDR output tells the display its content goes down to 0 nits, which only an OLED (or a
local-dimming panel with its zones off) actually shows. An LCD's black glows a little, so everything the game draws
below that level gets lost in it: caves and nights lose their shadow detail.

Black Level (Display) is the display's darkest black, from 0.00 to 1.00 nits in steps of 0.01, default 0.
The HDR rows now follow the order calibration tools use (Windows HDR Calibration among them): first what the display
can do, Black Level and Peak Brightness, then Paper White, which is a choice within that range.

What the setting does:

  • The picture: the HDR pass lifts the shadows onto it with ITU-R BT.2390's black level lift (its EETF without the
    knee), on the PQ signal: E' = E + PQ(black) · (1 − E / PQ(peak))⁴. Black lands exactly on the black level, the
    peak stays where it is, and the lift fades out by the fourth power on the way up. At a black level of 0.2 nits on a
    500 nit peak: 0 → 0.2, 0.1 → 0.51, 1 → 1.75, 10 → 11.1, 100 nits and up unchanged. Both outputs get it: HDR10
    directly in PQ, scRGB through PQ and back.
  • The metadata: VK_EXT_hdr_metadata's minimum luminance is the black level instead of 0.
  • At 0 (the default) neither changes: the shader skips the lift, so the picture is bit for bit what it was.

horizon-graphics.txt gets hdrBlackLevel in hundredths of a nit (0..100).

This is also the first piece the HDR calibration step we'd like to add later needs ("lower until the logo
disappears").

Testing: checked on an OLED (AW3423DW, HDR10 on KDE Plasma): at 0 the picture is unchanged, and
raising it lifts the shadows. We don't have an HDR LCD, so how it looks on one is untested. Reports from anyone who
has one are welcome.

Conflicts with #2705 in three small places (both add fields to the HDR parameters and edit the same docs paragraph).
Whichever lands second, I'll rebase.

Vanilla reference

Horizon-only (HDR output). Unchanged with HDR off, and with HDR on at the default black level.

Self-check

pr_ready (tools/pr_ready.py --quick on b3a9478cfbb5, against origin/main at b6c936f82, 1 min 25 s)

Check Result
Scope ✅ 8 files, +63 −15
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 398 passed (33 s)
rustfmt ✅ (7 s)
clippy ✅ (16 s)
tests: horizon-client, horizon-hdr ✅ 1261 passed (23 s)
doc tests ✅ 0 passed (6 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label feature

Screenshots

HDR can't be shown in an SDR screenshot; the settings row: Black Level: 0.00 nits.


🔄 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/3145 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `hdr-black` --- ### 📝 Commits (4) - [`5479b03`](https://github.com/horizon-rust/horizon/commit/5479b0362f3a87531c7d673732b515c804ddfdce) HDR: a black level setting, for displays whose black isn't 0 - [`fb0454d`](https://github.com/horizon-rust/horizon/commit/fb0454d001ad671ebd1e30ef1fa74b200f93b01c) Merge remote-tracking branch 'origin/main' into hdr-black - [`5134f84`](https://github.com/horizon-rust/horizon/commit/5134f8459ecd54c92b5122a0b01832c74509783f) Merge remote-tracking branch 'origin/main' into hdr-black - [`b19d865`](https://github.com/horizon-rust/horizon/commit/b19d8659ff0dceb9f8b725ae0858b9f8886fb6bc) Merge main into hdr-black: settings now also save taa and upscaling ### 📊 Changes **8 files changed** (+70 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+12 -4) 📝 `crates/horizon-client-render/src/gfx/hdr.rs` (+4 -1) 📝 `crates/horizon-client-render/src/graphics.rs` (+8 -1) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+15 -3) 📝 `crates/horizon-client-render/src/hdr.wgsl` (+24 -1) 📝 `crates/horizon-client/src/game/options.rs` (+1 -0) 📝 `crates/horizon-hdr/src/lib.rs` (+5 -4) 📝 `docs/graphics.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Senjin's AI agent (Claude Code), not by Senjin. ## What and why Follows #2021, part of #1441. HDR output tells the display its content goes down to 0 nits, which only an OLED (or a local-dimming panel with its zones off) actually shows. An LCD's black glows a little, so everything the game draws below that level gets lost in it: caves and nights lose their shadow detail. **Black Level** (Display) is the display's darkest black, from 0.00 to 1.00 nits in steps of 0.01, default 0. The HDR rows now follow the order calibration tools use (Windows HDR Calibration among them): first what the display can do, Black Level and Peak Brightness, then Paper White, which is a choice within that range. What the setting does: - **The picture:** the HDR pass lifts the shadows onto it with ITU-R BT.2390's black level lift (its EETF without the knee), on the PQ signal: `E' = E + PQ(black) · (1 − E / PQ(peak))⁴`. Black lands exactly on the black level, the peak stays where it is, and the lift fades out by the fourth power on the way up. At a black level of 0.2 nits on a 500 nit peak: 0 → 0.2, 0.1 → 0.51, 1 → 1.75, 10 → 11.1, 100 nits and up unchanged. Both outputs get it: HDR10 directly in PQ, scRGB through PQ and back. - **The metadata:** `VK_EXT_hdr_metadata`'s minimum luminance is the black level instead of 0. - **At 0** (the default) neither changes: the shader skips the lift, so the picture is bit for bit what it was. `horizon-graphics.txt` gets `hdrBlackLevel` in hundredths of a nit (0..100). This is also the first piece the HDR calibration step we'd like to add later needs ("lower until the logo disappears"). **Testing:** checked on an OLED (AW3423DW, HDR10 on KDE Plasma): at 0 the picture is unchanged, and raising it lifts the shadows. We don't have an HDR LCD, so how it looks on one is untested. Reports from anyone who has one are welcome. Conflicts with #2705 in three small places (both add fields to the HDR parameters and edit the same docs paragraph). Whichever lands second, I'll rebase. ## Vanilla reference Horizon-only (HDR output). Unchanged with HDR off, and with HDR on at the default black level. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on b3a9478cfbb5, against origin/main at b6c936f82, 1 min 25 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +63 −15 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 398 passed (33 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (16 s) | | tests: horizon-client, horizon-hdr | ✅ 1261 passed (23 s) | | doc tests | ✅ 0 passed (6 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | `feature` | ## Screenshots HDR can't be shown in an SDR screenshot; the settings row: `Black Level: 0.00 nits`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:12 +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#4821
No description provided.