Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Ports RenoDX's PsychoV35 scene tone mapper (the
zelda-oot-ozlook) 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.cppandvk_dlss.cpp(different HDR model, novk_temporal/vk_fsr3chain). The IR passes are GPL-3.0 like the rest of the eden recompiler.Changes
dlss_out16.compfor 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.