Add RenoDX HDR tone mapper (RenoDRT/DICE/Hermite) with F10 live settings #70

Open
github-bot wants to merge 7 commits from github-bot/gh-70 into main AGit
Owner

@⁠wh1te-rgb on GitHub · 2026-12-05 17:16 UTC · original
wh1te-rgb:pr/renodx-hdr → main · +2244 −22 · 20 files · 7 commits · open

Adds an optional RenoDX HDR tone mapper for native HDR10 displays (LARP_HDR=1), with both environment variable configuration and live F10 menu controls.

Summary

  • Tone mapping pipeline (crates/larp-gpu/src/renodx.rs, draw.rs, barriers.rs, pipeline.rs, hdr.rs):
    • Hooks game's ACES LUT bake (CS_BakeACES) and final HDR output blit pass on HDR10 surfaces.
    • Supports RenoDRT, DICE, and Hermite tone mappers (off by default).
    • Live-tunable parameters without restarting: Peak nits (auto / 200..10000), Paper White (80..500), Exposure (EV), Contrast, Shadows, Highlights, Saturation, Blowout, and Flare.
  • Settings & F10 UI (crates/larp-game/src/settings.rs, crates/larp-hle/src/settings.rs):
    • Registers all renodx* options in settings.ini and the F10 overlay menu (with live clamping/formatting and DARNER_RENODX_* env fallbacks matching hdr.rs).
  • Localization & Docs (locales/*.json, docs/environment-variables.md):
    • Adds translations across all 7 locales (en, de, fr, pl, tr, zh-CN, zh-TW) and documents LARP_RENODX* variables.

Verification

  • cargo check -p larp-core -p larp-game -p larp-gpu -p larp-hle
  • cargo test -p larp-core (7 passed)
  • cargo test -p larp-game (60 passed)
  • cargo test -p larp-gpu renodx (3 passed)
  • Verified in-game on Windows HDR10 display (RTX 5070): live F10 toggling & parameter tuning work across RenoDRT / DICE / Hermite.
**@⁠wh1te-rgb** on GitHub · 2026-12-05 17:16 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70) `wh1te-rgb:pr/renodx-hdr` → `main` · +2244 −22 · 20 files · 7 commits · open Adds an optional RenoDX HDR tone mapper for native HDR10 displays (`LARP_HDR=1`), with both environment variable configuration and live `F10` menu controls. ### Summary - **Tone mapping pipeline (`crates/larp-gpu/src/renodx.rs`, `draw.rs`, `barriers.rs`, `pipeline.rs`, `hdr.rs`)**: - Hooks game's ACES LUT bake (`CS_BakeACES`) and final HDR output blit pass on HDR10 surfaces. - Supports **RenoDRT**, **DICE**, and **Hermite** tone mappers (`off` by default). - Live-tunable parameters without restarting: Peak nits (`auto` / `200..10000`), Paper White (`80..500`), Exposure (`EV`), Contrast, Shadows, Highlights, Saturation, Blowout, and Flare. - **Settings & F10 UI (`crates/larp-game/src/settings.rs`, `crates/larp-hle/src/settings.rs`)**: - Registers all `renodx*` options in `settings.ini` and the `F10` overlay menu (with live clamping/formatting and `DARNER_RENODX_*` env fallbacks matching `hdr.rs`). - **Localization & Docs (`locales/*.json`, `docs/environment-variables.md`)**: - Adds translations across all 7 locales (`en`, `de`, `fr`, `pl`, `tr`, `zh-CN`, `zh-TW`) and documents `LARP_RENODX*` variables. ### Verification - `cargo check -p larp-core -p larp-game -p larp-gpu -p larp-hle` - `cargo test -p larp-core` (7 passed) - `cargo test -p larp-game` (60 passed) - `cargo test -p larp-gpu renodx` (3 passed) - Verified in-game on Windows HDR10 display (RTX 5070): live `F10` toggling & parameter tuning work across `RenoDRT` / `DICE` / `Hermite`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 17:24:02 +00:00
Author
Owner

@⁠gamingwithhomie on GitHub · 2026-12-05 18:50 UTC · original

Reviewed in detail - great work, and the tone-mapping math tests are solid. Holding merge for one default-behavior bug:

With RenoDX off, settings load still calls ask_paper_white(value.unwrap_or(203.0)) -> hdr::set_paper_white(203.0) for every user who hasnt explicitly set a Reno paper-white. That silently changes the existing HDR paper white from 150 nits (current default, and an explicit LARP_HDR_PAPER_WHITE) to 203 nits, even with renodx = off.

Also, while off, every CS_BakeACES dispatch still allocates a LUT backup + records a full copy, and every PS_BlitHDRACES draw runs descriptor/CBV probing.

Requested changes:

  1. Only push paper white into hdr when RenoDX is enabled or the user explicitly set a Reno paper-white; otherwise leave the existing HDR value/default untouched.
  2. Gate the LUT backup allocation/copy and blit probing on mode() != Off.

With those two fixes this becomes ready to merge. Thank you!

**@⁠gamingwithhomie** on GitHub · 2026-12-05 18:50 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7443483375) Reviewed in detail - great work, and the tone-mapping math tests are solid. **Holding merge for one default-behavior bug:** With RenoDX **off**, settings load still calls `ask_paper_white(value.unwrap_or(203.0))` -> `hdr::set_paper_white(203.0)` for every user who hasnt explicitly set a Reno paper-white. That silently changes the existing HDR paper white from **150 nits (current default, and an explicit `LARP_HDR_PAPER_WHITE`)** to **203 nits**, even with `renodx = off`. Also, while off, every `CS_BakeACES` dispatch still allocates a LUT backup + records a full copy, and every `PS_BlitHDRACES` draw runs descriptor/CBV probing. Requested changes: 1. Only push paper white into `hdr` when RenoDX is enabled or the user explicitly set a Reno paper-white; otherwise leave the existing HDR value/default untouched. 2. Gate the LUT backup allocation/copy and blit probing on `mode() != Off`. With those two fixes this becomes ready to merge. Thank you!
Author
Owner

@⁠Heliumrich on GitHub · 2026-12-05 19:37 UTC · original · edited 2026-12-05 22:55 UTC

Please add a UI nits setting, the world map is burning my eyes
and what about their PsychoV35 psychovisual tonemapper ?

**@⁠Heliumrich** on GitHub · 2026-12-05 19:37 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7444133492) · edited 2026-12-05 22:55 UTC Please add a UI nits setting, the world map is burning my eyes and what about their PsychoV35 psychovisual tonemapper ?
Author
Owner

@⁠Heliumrich on GitHub · 2026-12-05 22:10 UTC · original · edited 2026-12-05 23:46 UTC

This HDR is infinitely better than the native one. Tested on my AW3225QF 4K 12bit OLED monitor
I just find the UI a bit bad ; I would set peak to 420/450, and I can only choose 400 or 600

Improvements :

  • Add UI nits value so the world map is not burning our eyes
  • Force all settings to be greyed out until LARP_HDR=1 is enabled, or better yet : add this "Enable HDR" in the UI
  • Add their PsychoV35 tonemapper
**@⁠Heliumrich** on GitHub · 2026-12-05 22:10 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7446424638) · edited 2026-12-05 23:46 UTC This HDR is infinitely better than the native one. Tested on my AW3225QF 4K 12bit OLED monitor I just find the UI a bit bad ; I would set peak to 420/450, and I can only choose 400 or 600 Improvements : - Add UI nits value so the world map is not burning our eyes - Force all settings to be greyed out until ``LARP_HDR=1`` is enabled, or better yet : add this "Enable HDR" in the UI - Add their PsychoV35 tonemapper
Author
Owner

@⁠wh1te-rgb on GitHub · 2026-12-06 01:11 UTC · original

Thanks for the thorough review and testing! Pushed commits d3205f6 and 332b50b to address both requested changes:

  1. Preserve existing HDR paper_white when RenoDX is off:
    • Changed ask_paper_white to accept Option<f64> instead of eagerly pushing 203.0 on default.
    • hdr::set_paper_white is now only updated when RenoDX is enabled or renodx_paper_white / LARP_RENODX_PAPER_WHITE is explicitly set; switching back to off without an explicit value restores the base HDR value (LARP_HDR_PAPER_WHITE or 150 nits).
  2. Gate CS_BakeACES LUT backup/copy and PS_BlitHDRACES probing on mode() != Mode::Off:
    • Both dispatch and draw hooks are skipped when Off, with a single one-shot restore (NEEDS_RESTORE) when toggling from an active mode back to Off that restores the original LUT and drops the backup state.

Also expanded renodx_peak presets to 400..800 in steps of 50 (including 420 for TrueBlack 400 panels) and 800..2000 in steps of 100 (note: F10 and settings.ini are fixed choice lists without free-text numeric input, while LARP_RENODX_PEAK=<nits> accepts any custom value in 200..10000). Keeping separate UI nits, conditional greying-out, and additional tonemappers out of this PR so the merge scope stays minimal — happy to follow up on those after merge.

**@⁠wh1te-rgb** on GitHub · 2026-12-06 01:11 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7448975554) Thanks for the thorough review and testing! Pushed commits `d3205f6` and `332b50b` to address both requested changes: 1. **Preserve existing HDR `paper_white` when RenoDX is `off`**: - Changed `ask_paper_white` to accept `Option<f64>` instead of eagerly pushing `203.0` on `default`. - `hdr::set_paper_white` is now only updated when RenoDX is enabled or `renodx_paper_white` / `LARP_RENODX_PAPER_WHITE` is explicitly set; switching back to `off` without an explicit value restores the base HDR value (`LARP_HDR_PAPER_WHITE` or `150` nits). 2. **Gate `CS_BakeACES` LUT backup/copy and `PS_BlitHDRACES` probing on `mode() != Mode::Off`**: - Both dispatch and draw hooks are skipped when `Off`, with a single one-shot restore (`NEEDS_RESTORE`) when toggling from an active mode back to `Off` that restores the original LUT and drops the backup state. Also expanded `renodx_peak` presets to `400..800` in steps of `50` (including `420` for TrueBlack 400 panels) and `800..2000` in steps of `100` (note: F10 and `settings.ini` are fixed choice lists without free-text numeric input, while `LARP_RENODX_PEAK=<nits>` accepts any custom value in `200..10000`). Keeping separate UI nits, conditional greying-out, and additional tonemappers out of this PR so the merge scope stays minimal — happy to follow up on those after merge.
Author
Owner

@⁠vanya890 on GitHub · 2026-12-06 01:37 UTC · original

The updated off_mode_gates_hooks_and_preserves_hdr_paper_white test covers the original regression well: turning RenoDX off restores the stock 150-nit paper white, while an explicit RenoDX value is kept only until reset. One extra boundary worth covering is an explicit base LARP_HDR_PAPER_WHITE override while RenoDX remains off. The new reset path is intended to preserve that user setting too; a small isolated test for the env override would guard against accidentally restoring the hard-coded 150-nit default instead.

**@⁠vanya890** on GitHub · 2026-12-06 01:37 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7449321699) The updated `off_mode_gates_hooks_and_preserves_hdr_paper_white` test covers the original regression well: turning RenoDX off restores the stock 150-nit paper white, while an explicit RenoDX value is kept only until reset. One extra boundary worth covering is an explicit base `LARP_HDR_PAPER_WHITE` override while RenoDX remains off. The new reset path is intended to preserve that user setting too; a small isolated test for the env override would guard against accidentally restoring the hard-coded 150-nit default instead.
Author
Owner

@⁠wh1te-rgb on GitHub · 2026-12-06 01:43 UTC · original

Good catch! Added an isolated integration test in crates/larp-gpu/tests/renodx_paper_white_env.rs (commit 38ff2fe, separate test process so OnceLock env initialization is uncontaminated):

  • Sets LARP_HDR_PAPER_WHITE=120 and verifies that RenoDX off-mode initialization, toggling RenoDRT -> Off, and resetting an explicit renodx_paper_white back to None while off all preserve/restore 120.0 nits instead of falling back to 150.0.
  • Verified with cargo test -p larp-gpu --test renodx_paper_white_env (1 passed) and cargo test -p larp-gpu renodx (4 passed).
**@⁠wh1te-rgb** on GitHub · 2026-12-06 01:43 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7449394747) Good catch! Added an isolated integration test in `crates/larp-gpu/tests/renodx_paper_white_env.rs` (commit `38ff2fe`, separate test process so `OnceLock` env initialization is uncontaminated): - Sets `LARP_HDR_PAPER_WHITE=120` and verifies that `RenoDX` off-mode initialization, toggling `RenoDRT -> Off`, and resetting an explicit `renodx_paper_white` back to `None` while off all preserve/restore `120.0` nits instead of falling back to `150.0`. - Verified with `cargo test -p larp-gpu --test renodx_paper_white_env` (1 passed) and `cargo test -p larp-gpu renodx` (4 passed).
Author
Owner

@⁠y9999 on GitHub · 2026-12-06 02:47 UTC · original

Hi @⁠wh1te-rgb, thanks for the PR — tested it on an AW3225QF (HDR Peak 1000 mode, RTX 5080), and it works great.

While testing, we built a few additions on top of your branch (38ff2fe), which you might want for the follow-up you mentioned. Branch: https://github.com/y9999/larp/tree/renodx-extras (commits 2bfaa21 and 99b0f77):

  1. Vanilla Color (renodx_vanilla_color, default 100%): the bake reads the game's own ACES LUT (the backup you already keep, now also bound as an SRV) at the same texel, and takes its hue and colourfulness (OkLab chroma/lightness) at RenoDX's lightness. ACES maps per channel in AP1, which a luminance curve doesn't reproduce, so with RenoDRT alone the picture was noticeably less saturated than native, even at equal paper white. With it, hue and saturation match native 1:1, and only the luminance is RenoDX's. Blowout then defaults to 0, since the ACES highlight desaturation comes along.
  2. UI brightness (renodx_ui_scale): the technique by moistman7 (fefw-recomp ui_nits). The blit multiplies the whole picture by k, and the LUT divides the scene by k, so only what the game draws after the LUT (HUD, map, menus) changes. Tested: the scene is unchanged and only the HUD/map moves. This should cover the "UI nits" request from Heliumrich.
  3. The game's LUT is only backed up and rewritten on an HDR10 output (on SDR, the game's own LUT/blit are untouched).
  4. Reuse of the LUT backup + bake descriptor heap between bakes, instead of a new 3D texture and shader-visible heap every CS_BakeACES dispatch. While toggling RenoDX and UI brightness repeatedly, we hit a device hang (0x887A0006), and the log showed millions of objects waiting for release. With the reuse, there were no hangs in the same test.

Probe info from this setup, in case it helps: LUT 64³ R16G16B16A16_FLOAT (so no UNORM precision issue); output R10G10B10A2 PQ; the native path is ACES SSTS with min 0.005 / max 1000 nits.

Happy to open this as a follow-up PR once #70 is merged (crediting you and moistman7), or feel free to cherry-pick it into yours if you prefer. The branch also has a Windows build workflow for my fork, which wouldn't be part of a PR.

**@⁠y9999** on GitHub · 2026-12-06 02:47 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7450208082) Hi @⁠wh1te-rgb, thanks for the PR — tested it on an AW3225QF (HDR Peak 1000 mode, RTX 5080), and it works great. While testing, we built a few additions **on top of your branch (38ff2fe)**, which you might want for the follow-up you mentioned. Branch: https://github.com/y9999/larp/tree/renodx-extras (commits `2bfaa21` and `99b0f77`): 1. **Vanilla Color** (`renodx_vanilla_color`, default 100%): the bake reads the game's own ACES LUT (the backup you already keep, now also bound as an SRV) at the same texel, and takes its hue and colourfulness (OkLab chroma/lightness) at RenoDX's lightness. ACES maps per channel in AP1, which a luminance curve doesn't reproduce, so with RenoDRT alone the picture was noticeably less saturated than native, even at equal paper white. With it, hue and saturation match native 1:1, and only the luminance is RenoDX's. Blowout then defaults to 0, since the ACES highlight desaturation comes along. 2. **UI brightness** (`renodx_ui_scale`): the technique by moistman7 (fefw-recomp `ui_nits`). The blit multiplies the whole picture by k, and the LUT divides the scene by k, so only what the game draws after the LUT (HUD, map, menus) changes. Tested: the scene is unchanged and only the HUD/map moves. This should cover the "UI nits" request from Heliumrich. 3. The game's LUT is only backed up and rewritten on an **HDR10** output (on SDR, the game's own LUT/blit are untouched). 4. **Reuse of the LUT backup + bake descriptor heap** between bakes, instead of a new 3D texture and shader-visible heap every `CS_BakeACES` dispatch. While toggling RenoDX and UI brightness repeatedly, we hit a device hang (`0x887A0006`), and the log showed millions of objects waiting for release. With the reuse, there were no hangs in the same test. Probe info from this setup, in case it helps: LUT 64³ `R16G16B16A16_FLOAT` (so no UNORM precision issue); output `R10G10B10A2` PQ; the native path is ACES SSTS with min 0.005 / max 1000 nits. Happy to open this as a follow-up PR once #70 is merged (crediting you and moistman7), or feel free to cherry-pick it into yours if you prefer. The branch also has a Windows build workflow for my fork, which wouldn't be part of a PR.
- Vanilla Color (renodx_vanilla_color / LARP_RENODX_VANILLA_COLOR, default 100%): preserve title ACES hue/chroma in OkLab at RenoDX lightness, with non-negative AP1 clamping and blowout defaulting to 0.
- UI Brightness (renodx_ui_scale / LARP_RENODX_UI_SCALE, default 100%): scale blit and divide scene LUT output so HUD/menus adjust independently (technique by moistman7, fefw-recomp ui_nits).
- Skip LUT backup/bake when HDR10 is inactive (!hdr_active()).
- Reuse LUT backup texture and bake descriptor heap across CS_BakeACES dispatches to prevent D3D12 object churn and 0x887A0006 device hang.
- Add full 9-language locale translations in sorted order and align settings parser bounds with clamp ranges.

Credits: y9999 (renodx-extras) and moistman7 (ui_nits).
Author
Owner

@⁠wh1te-rgb on GitHub · 2026-12-06 03:00 UTC · original

Thanks a lot @⁠y9999 for the thorough testing and the great additions (especially catching the 0x887A0006 device hang from LUT/heap churn and the probe details)!

I've integrated all four improvements from renodx-extras into this PR in 94f1bde (crediting you and moistman7, without the fork workflow), along with a few polish tweaks:

  • Added full translations across all 9 locales (kept in sorted key order)
  • Clamped lut_vanilla reads to non-negative values before OkLab conversion
  • Aligned the settings parser bounds with the runtime clamp ranges (0.0..=1.0 for renodx_vanilla_color, 0.1..=2.0 for renodx_ui_scale) and added a unit test for both

All workspace checks and larp-core / larp-game / larp-gpu / larp-hle tests pass. Ready for another look whenever convenient!

**@⁠wh1te-rgb** on GitHub · 2026-12-06 03:00 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7450362668) Thanks a lot @⁠y9999 for the thorough testing and the great additions (especially catching the `0x887A0006` device hang from LUT/heap churn and the probe details)! I've integrated all four improvements from `renodx-extras` into this PR in `94f1bde` (crediting you and moistman7, without the fork workflow), along with a few polish tweaks: - Added full translations across all 9 locales (kept in sorted key order) - Clamped `lut_vanilla` reads to non-negative values before OkLab conversion - Aligned the settings parser bounds with the runtime clamp ranges (`0.0..=1.0` for `renodx_vanilla_color`, `0.1..=2.0` for `renodx_ui_scale`) and added a unit test for both All workspace checks and `larp-core` / `larp-game` / `larp-gpu` / `larp-hle` tests pass. Ready for another look whenever convenient!
Author
Owner

@⁠Heliumrich on GitHub · 2026-12-06 03:13 UTC · original

Dude dont use the shitty 1000 nits mode on these oled panels 😭
400 true black otherwise eotf curve is fucked ; no contrast in highlight, looks like shit, ABL flicker like crazy from scene change, ...

**@⁠Heliumrich** on GitHub · 2026-12-06 03:13 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7450522063) Dude dont use the shitty 1000 nits mode on these oled panels 😭 400 true black otherwise eotf curve is fucked ; no contrast in highlight, looks like shit, ABL flicker like crazy from scene change, ...
Author
Owner

@⁠wh1te-rgb on GitHub · 2026-12-06 03:21 UTC · original

lmao facts, that exact Peak 1000 EOTF mess and aggressive ABL drove me nuts too. Honestly it's half the reason I literally just switched from OLED to a glossy MiniLED a couple days ago, finally getting real highlights without the TB400 compromise or burn-in anxiety.

**@⁠wh1te-rgb** on GitHub · 2026-12-06 03:21 UTC · [original](https://github.com/gamingwithhomie/larp/pull/70#issuecomment-7450626371) lmao facts, that exact Peak 1000 EOTF mess and aggressive ABL drove me nuts too. Honestly it's half the reason I literally just switched from OLED to a glossy MiniLED a couple days ago, finally getting real highlights without the TB400 compromise or burn-in anxiety.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/70/head:github-bot/gh-70'
git switch 'github-bot/gh-70'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-70'
git switch 'github-bot/gh-70'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-70'
git switch 'github-bot/gh-70'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-70'
git switch 'main'
git merge --squash 'github-bot/gh-70'
git switch 'main'
git merge --ff-only 'github-bot/gh-70'
git switch 'main'
git merge 'github-bot/gh-70'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.