Skip to content

Add RenoDX PsychoV35 HDR tone mapper with native HDR upscaling - #211

Open
rar112 wants to merge 6 commits into
pixl27:mainfrom
rar112:renodx-psychov35
Open

rar112 wants to merge 6 commits into
pixl27:mainfrom
rar112:renodx-psychov35

Conversation

@rar112

@rar112 rar112 commented Nov 26, 2026 •

Copy link
Copy Markdown

What this does

Ports RenoDX's PsychoV35 scene tone mapper (the zelda-oot-oz look) and its HDR10 output encoder into ProjectReLink's Vulkan shader recompiler, running natively (no ReShade addon), and makes the upscalers (DLSS/FSR and the game's own network) consume the same RGBA16F HDR scene, so the tone map is applied before upscaling.

Credit

The tone-mapper math and grading are RenoDX by clshortfuse (MIT, LICENSE-renodx.md). The IR-level approach - replacing the scene-mapping program and PQ encoder in the recompiled shader - was adapted from Duck912's native-HDR work in HeyListen PR #101, which builds on the Longshot/Hookshot authors credited there.

Not a copy: ProjectReLink's renderer is an older, diverged snapshot, so the wiring is re-derived against ReLink's own vk_shader.cpp, vk_draw.cpp, vk_menu.cpp and vk_dlss.cpp (different HDR model, no vk_temporal/vk_fsr3 chain). The IR passes are GPL-3.0 like the rest of the eden recompiler.

Changes

  • HDR tone mapper (Vanilla / PsychoV35) plus the full RenoDX grading set - peak/game/UI brightness, HDR tuning (collapsible), colour space, midgrey, tone slope, hue clip emulation, exposure, highlights, shadows, contrast, saturation, bloom, reset.
  • The scene buffer becomes RGBA16F while PsychoV35 is on, so highlights don't band; the picture output follows, and DLSS/FSR and the game's own upscaler take the RGBA16F scene (linear) instead of R11G11B10F.
  • A new dlss_out16.comp for the RGBA16F picture output path.

Tested

Built with llvm-mingw and verified in-game on an HDR display: the tone mapper engages, every slider affects the picture live, and the upscalers run on the HDR scene without banding.

Port HeyListen's RenoDX (PsychoV35, zelda-oot-oz) scene tone mapper and
HDR10 output encoder into ReLink's eden shader recompiler, with the grading
UI and an RGBA16F scene buffer for native HDR.

- Copy psychov35.h (MIT), scene_tonemap_pass.h, output_encode_pass.h
  (GPL-3.0) and LICENSE-renodx.md verbatim from HeyListen.
- shader_info.h: MAX_CBUFS 18 -> 20 (bank 19: PsychoV35 grading).
- vk_shader: detect the game's tone-map fit and PQ encoder by code
  constants (scene_fit/pq_fit); scene_tonemap_for + graphics_key tonemap
  param; p.scene_tonemap threading in program_pick/seed_variant_of/
  program_set_key; pass invocation in translate_into; cache invalidation
  on the tone-mapper change.
- vk_menu: HDR tone mapper row + 11 PsychoV35 grading rows and reset;
  scene_tonemap_on/psychov35_bank/psychov35_reset; row visibility.
- vk_draw: uniform_range bank 19 (the renderer's grading bank).
- vk_replay: HOS_OPT_HDR_TONEMAP (74) option answer.
- host/nn_vi.c + nx2/oot_patches.py: hos_scene_rgba16f (RGBA16F scene
  buffer) while the tone mapper is on.
The display's own peak (hdr_peak_nits, DXGI) is the default (0 = Display);
an override in nits sets kSettingPeak instead, clamped to stay at or above
the paper white.
The scene's white reference (RenoDX's Game brightness), 80-500 nits, feeds
kSettingPeak's white instead of the hidden hdr_paper_white. Independent of
the game's own interface paper white.
- Peak brightness defaults to 1000 nits; the 'Display' choice is dropped
  (plain nits, 100..10000).
- New HDR tuning toggle: the fine PsychoV35 sliders collapse behind it
  (Hidden by default) so the display rows stay together; the three
  brightness rows and the toggle stay visible.
- Fix slider mouse drags: the drag drives off the track's endpoints as
  at press, not the drawn track (which shifts under the cursor as the
  value text changes width).
With the PsychoV35 tone mapper on, the linear scene buffer is RGBA16F
(hos_scene_rgba16f) instead of R11G11B10F, so the upscaler entry points
that gate on VK_FORMAT_B10G11R11_UFLOAT_PACK32 silently fell back to the
game's network. Relax the scene-side format gates only (camera/scene
detection, the gameplay-network input) to also accept
VK_FORMAT_R16G16B16A16_SFLOAT while scene_tonemap_on(); the picture
output gate is left B10G11R11 pending the running-game log.
The running-game log showed the gameplay upscale network reads and writes
format 97 (VK_FORMAT_R16G16B16A16_SFLOAT) on both sides while the
PsychoV35 tone mapper is on, so the picture output is RGBA16F too, not
just the scene. Relax the picture-output gates (the !known gameplay
network, the No-upscaling path and the DLSS/FSR path) and the
composite/bloom capture to accept RGBA16F under scene_tonemap_on(), and
give dlss_out.comp an RGBA16F twin (dlss_out16.comp) whose storage format
matches the picture it writes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant