WIP: feat(vk): PsychoV35 as RenoDX's zelda-oot-oz has it: its settings, its scene and its HDR output #1393

Draft
LRF17 wants to merge 1 commit from LRF17/Longshot:psychov35-look into main
First-time contributor

Type: feat · Risk: medium · Tested on: Windows 11, RTX 4090 (driver 610.47) · Needs: Linux; AMD and Intel GPUs

Why

With the HDR tone mapper on PsychoV35, the picture is RenoDX's zelda-oot-oz mod at its defaults, and not quite even
that: none of the mod's settings can be changed, the scene still differs from the mod's (its warm torch and lantern
light is missing), the UI is drawn at the paper white and is far too bright (#843), and the picture goes out through
the game's own encoder matrix where the mod uses BT.709. Players who use the mod elsewhere notice all four.

What changed

PsychoV35 now matches the mod: its settings in the menu, read live; its scene; and its HDR output with a colour space
choice and a UI brightness of its own. Everything is found in the translated IR (nothing of the game's code is kept),
and the settings reach the programs through a constant bank the renderer owns, read at each draw, so a change shows at
once with nothing translated again.

  • settings: ir_opt/psychov35.h takes Settings (test35.hlsl's grading of the neutral level and the cones;
    Defaults are the mod's); ir_opt/scene_tonemap_pass.h reads them with GetFloatCbuf from bank
    PsychoV35::kSettingsBank (19) and adds it to the program's constant buffers; shader_info.h MAX_CBUFS 18 -> 20;
    vk_draw.cpp uniform_range fills bank 19 from psychov35_bank (vk_menu.cpp).
  • menu: vk_menu.cpp the mod's rows under HDR, in its order, as sliders, shown with Native HDR and PsychoV35, and
    "PsychoV35 reset all"; the HDR contrast row hidden with PsychoV35 (its own Contrast grades the scene), and
    vk_framegen.cpp no longer grades the picture a second time.
  • scene: as the mod's 0x09EB4538 and 0xED732BB7 with a custom tone mapper: the adapted permutation's local exposure
    left out and its blue times the exposure once more (the mod's native gain (g, g, g*g)); the bloom term scaled by
    Bloom; the peak the HDR peak over the paper white; the scene in the UI's white.
  • HDR output: new ir_opt/output_encode_pass.h, as the mod's output_0x92D6F81D: the game's HDR10 encoder, found by
    PQ's constants and its 1e-4 in its code (vk_shader.cpp Code::pq_fit) and keyed with PsychoV35's programs, writes
    the chosen colour space's BT.2020 light (Vanilla: the game's matrix over its white; BT.709 and DCI-P3: RenoDX's
    matrices) times the UI's white, then PQ.
  • docs: the README's option table.

Measurements

Verdict: no measurable cost: the GPU time a frame is the same as main's within the log's 0.1 ms, PsychoV35 on and off, and the fps too.

Baseline: measured together with #1394 on top (6ee92f93), which contains this one: the pair costs nothing measurable, so neither does this one.
Hardware: Windows 11 Pro, RTX 4090 (driver 610.47), 64 GB RAM, 16 threads; the picture streamed at 120 Hz while measured
Scene: Hyrule Castle Town at night, child Link standing still in front of the stables; 3840x2160, Native HDR, DLSS Quality (2560x1440, preset K), frame generation off, frame rate uncapped, V-Sync off
Method: the GPU time a frame from longshot_log.txt (vk: GPU time ... ms a frame, every 120 presents): the median of the last ~60 lines of 2 minutes standing still; runs interleaved (main, this PR, main, this PR) after a warm-up run of each, the same build toolchain (v3.0.0-rc.7) for both sides and the options pinned with HOS_OPTIONS_FILE; fps alongside, bound by the stream's presentation (~91)
How to reproduce: a save in Castle Town at night; the settings above; each run 2 minutes standing still once in place

Before: main @ 544229a2 After, with the next PR on top: this PR @ 6ee92f93
GPU time a frame, PsychoV35 on (two runs; median) 7.3, 7.3; 7.3 ms 7.2, 7.3; 7.25 ms
GPU time a frame, PsychoV35 off (Vanilla) 7.2, 7.2; 7.2 ms 7.2, 7.2; 7.2 ms
fps, PsychoV35 on 90.6, 91.1 91.4, 91.5
fps, PsychoV35 off 91.8, 91.6 91.5, 91.8
(main, on)  vk: GPU time 7.3 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame
(PR, on)    vk: GPU time 7.2 ms a frame (the longest submission 4.0 ms); 0.0 textures made a frame
(main, off) vk: GPU time 7.2 ms a frame (the longest submission 4.3 ms); 0.0 textures made a frame
(PR, off)   vk: GPU time 7.2 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame
vk: program 672e593076ac390a: scene tone map PsychoV35
vk: program 0f764187830899cd: output encoder PsychoV35

Flags and settings

Thirteen menu rows (README's option table), all shown only with Native HDR and the PsychoV35 tone mapper; no switch.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
PsychoV35 UI brightness the menus' and HUD's white, in steps of 1 none (the paper white) 203 nits dimmer or brighter UI, the scene unchanged helps (#843) 203 (BT.2408's reference white, the mod's)
PsychoV35 color space Vanilla, BT.709, DCI-P3 none (the game's matrix) BT.709 the mod's colour space helps (the mod's default) BT.709
PsychoV35 midgray Render or Vanilla mid grey none Vanilla as the mod helps Vanilla
PsychoV35 match tone slope the game's slope at mid grey none On as the mod helps On
PsychoV35 tone slope, hue clip emulation the mod's, 0 to 100 none 50 as the mod helps 50
PsychoV35 exposure the scene at mid grey none 100% brighter or darker scene helps 100%
PsychoV35 highlights, shadows, contrast, saturation the mod's grading, 0 to 100 none 50 as the mod (contrast 0 breaks the picture, as in the mod) helps 50
PsychoV35 bloom the bloom's strength none (the game's) 50 0 none, 100 twice the game's helps 50
PsychoV35 reset all every row back to the mod's defaults none a button resets helps —

Testing

Tested: python -I -B tests/run_all.py on Windows 11: the same 68 failures as on main @ 544229a2, all of
them environment ones (listed below), nothing new. tests/test_psychov35.py compares the header
with RenoDX's path on 5518 colours and gradings; tests/scene_tonemap_ir.cpp checks the bank, the adapted gain, the
bloom and the scene's scale; tests/output_encode_ir.cpp checks the encoder against RenoDX's in double, in each colour
space and three UI whites. In the game (RTX 4090, Windows 11, Native HDR, PsychoV35, DLSS), side by side with the mod
(ReShade, zelda-oot-oz at its defaults): every row changes the picture at once and "reset all" brings the defaults
back; Hyrule Castle Town at night, the same warm torch and lantern light, the same bloom, the same colours in each
colour space and the same UI brightness as the mod; Lon Lon Ranch alley, child Link, the camera moved back and forth:
no warm/cool or brightness jump (#344's place). Contrast at 0 gives a broken picture, as the mod's does (test35.hlsl
divides the purity by the contrast); left as the mod has it.

The 68 checks that fail on main @ 544229a2 and here alike (this PC's environment: a compiler name it lacks, a CRLF checkout, tools not installed)

nx2/test_mesh_first_types.py, tests/test_alt_enter.py, tests/test_audio_deadline.py, tests/test_audio_output_errors.py, tests/test_audio_wave_buffer_release.py, tests/test_bc_levels.py, tests/test_bind_memo.py, tests/test_capture_copy_helpers.py, tests/test_collect_wide.py, tests/test_cpu_report.py, tests/test_dlss_actor.py, tests/test_dlss_checks.py, tests/test_dlss_math.py, tests/test_draw_binds.py, tests/test_env_file.py, tests/test_failed_compile_keeps_objects.py, tests/test_finish_output.py, tests/test_fps_overlay_order.py, tests/test_fps_rate.py, tests/test_fps_stats.py, tests/test_framegen_auto.py, tests/test_framegen_gate.py, tests/test_fsr3_math.py, tests/test_gpu_choice.py, tests/test_hd_rumble.py, tests/test_import_span.py, tests/test_job_queue.py, tests/test_jobs_wait_runs_queued.py, tests/test_menu_mouse_scroll.py, tests/test_mirror_inherit.py, tests/test_missing_nup.py, tests/test_movie_upscale_policy.py, tests/test_nvn_texture_handle.py, tests/test_oot_jitter.py, tests/test_pass_hazard.py, tests/test_pool_span.py, tests/test_present_ahead.py, tests/test_present_thread.py, tests/test_prof_clock.py, tests/test_profiling_mode.py, tests/test_prompt_auto_face.py, tests/test_push_state.py, tests/test_quick_pipelines.py, tests/test_report_words.py, tests/test_rt_pool_minimum.py, tests/test_rumble_mapping.py, tests/test_rumble_menu.py, tests/test_rumble_refresh.py, tests/test_run_all_changed.py, tests/test_same_bind.py, tests/test_same_draw.py, tests/test_same_dyn.py, tests/test_seed_reader.py, tests/test_skip_code.py, tests/test_slow_frames.py, tests/test_status_line.py, tests/test_submitted_page.py, tests/test_table_track.py, tests/test_target_image_pool.py, tests/test_tested_configurations.py, tests/test_tex_spans_once_a_present.py, tests/test_texture_layout_sizes.py, tests/test_ub_gap.py, tests/test_upscale_independent.py, tests/test_upscale_label.py, tests/test_vertex_bind.py, tests/test_vk_swapchain_compat.py, tests/test_wb_pages.py

Not tested: Linux, AMD and Intel GPUs: the change is in the translated IR and a uniform bank, nothing
vendor-specific.

Must be tested:

  • Linux, AMD (radv): Native HDR, PsychoV35, move each PsychoV35 row and "PsychoV35 UI brightness" in the pause menu,
    expecting the scene to change at once, the UI brightness to change the menus only, and no colour jump at Lon Lon
    Ranch (Test Farm: @Beanstalk linux amd, PsychoV35 rows change the HDR picture live)

Risks

What could break: the scene's colour with PsychoV35 where the game switches between its two scene permutations
(#344's symptom: PR #400 gave both the same gain; this follows the mod, which treats them apart; tested at Lon Lon
Ranch without a jump); the HDR output with PsychoV35 if another fragment program carried PQ's constants and 1e-4 (the
pass checks the whole shape and logs why it leaves a program); bank 19 on a driver with fewer than 20 uniform buffer
bindings per stage.

Turning it off: the HDR tone mapper row on Vanilla; else revert the commit.

Compatibility: the scene mapping and encoder programs are translated again once (the translator changed); the
options file gains the rows' keys; with PsychoV35 the defaults change the colour space from the game's matrix to
BT.709, as the mod's.

Issues

Fixes #843
See #344

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.

Made and published with the help of Claude Opus 5.5

**Type:** feat · **Risk:** medium · **Tested on:** Windows 11, RTX 4090 (driver 610.47) · **Needs:** Linux; AMD and Intel GPUs ## Why With the HDR tone mapper on PsychoV35, the picture is RenoDX's zelda-oot-oz mod at its defaults, and not quite even that: none of the mod's settings can be changed, the scene still differs from the mod's (its warm torch and lantern light is missing), the UI is drawn at the paper white and is far too bright (#843), and the picture goes out through the game's own encoder matrix where the mod uses BT.709. Players who use the mod elsewhere notice all four. ## What changed PsychoV35 now matches the mod: its settings in the menu, read live; its scene; and its HDR output with a colour space choice and a UI brightness of its own. Everything is found in the translated IR (nothing of the game's code is kept), and the settings reach the programs through a constant bank the renderer owns, read at each draw, so a change shows at once with nothing translated again. - settings: `ir_opt/psychov35.h` takes `Settings` (test35.hlsl's grading of the neutral level and the cones; `Defaults` are the mod's); `ir_opt/scene_tonemap_pass.h` reads them with `GetFloatCbuf` from bank `PsychoV35::kSettingsBank` (19) and adds it to the program's constant buffers; `shader_info.h` `MAX_CBUFS` 18 -> 20; `vk_draw.cpp` `uniform_range` fills bank 19 from `psychov35_bank` (`vk_menu.cpp`). - menu: `vk_menu.cpp` the mod's rows under HDR, in its order, as sliders, shown with Native HDR and PsychoV35, and "PsychoV35 reset all"; the HDR contrast row hidden with PsychoV35 (its own Contrast grades the scene), and `vk_framegen.cpp` no longer grades the picture a second time. - scene: as the mod's 0x09EB4538 and 0xED732BB7 with a custom tone mapper: the adapted permutation's local exposure left out and its blue times the exposure once more (the mod's native gain (g, g, g*g)); the bloom term scaled by Bloom; the peak the HDR peak over the paper white; the scene in the UI's white. - HDR output: new `ir_opt/output_encode_pass.h`, as the mod's output_0x92D6F81D: the game's HDR10 encoder, found by PQ's constants and its 1e-4 in its code (`vk_shader.cpp` `Code::pq_fit`) and keyed with PsychoV35's programs, writes the chosen colour space's BT.2020 light (Vanilla: the game's matrix over its white; BT.709 and DCI-P3: RenoDX's matrices) times the UI's white, then PQ. - docs: the README's option table. ## Measurements **Verdict:** no measurable cost: the GPU time a frame is the same as main's within the log's 0.1 ms, PsychoV35 on and off, and the fps too. Baseline: measured together with #1394 on top (6ee92f93), which contains this one: the pair costs nothing measurable, so neither does this one. Hardware: Windows 11 Pro, RTX 4090 (driver 610.47), 64 GB RAM, 16 threads; the picture streamed at 120 Hz while measured Scene: Hyrule Castle Town at night, child Link standing still in front of the stables; 3840x2160, Native HDR, DLSS Quality (2560x1440, preset K), frame generation off, frame rate uncapped, V-Sync off Method: the GPU time a frame from `longshot_log.txt` (`vk: GPU time ... ms a frame`, every 120 presents): the median of the last ~60 lines of 2 minutes standing still; runs interleaved (main, this PR, main, this PR) after a warm-up run of each, the same build toolchain (v3.0.0-rc.7) for both sides and the options pinned with `HOS_OPTIONS_FILE`; fps alongside, bound by the stream's presentation (~91) How to reproduce: a save in Castle Town at night; the settings above; each run 2 minutes standing still once in place | | Before: main @ 544229a2 | After, with the next PR on top: this PR @ 6ee92f93 | |---|---|---| | GPU time a frame, PsychoV35 on (two runs; median) | 7.3, 7.3; 7.3 ms | 7.2, 7.3; 7.25 ms | | GPU time a frame, PsychoV35 off (Vanilla) | 7.2, 7.2; 7.2 ms | 7.2, 7.2; 7.2 ms | | fps, PsychoV35 on | 90.6, 91.1 | 91.4, 91.5 | | fps, PsychoV35 off | 91.8, 91.6 | 91.5, 91.8 | ``` (main, on) vk: GPU time 7.3 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame (PR, on) vk: GPU time 7.2 ms a frame (the longest submission 4.0 ms); 0.0 textures made a frame (main, off) vk: GPU time 7.2 ms a frame (the longest submission 4.3 ms); 0.0 textures made a frame (PR, off) vk: GPU time 7.2 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame vk: program 672e593076ac390a: scene tone map PsychoV35 vk: program 0f764187830899cd: output encoder PsychoV35 ``` ### Flags and settings Thirteen menu rows (README's option table), all shown only with Native HDR and the PsychoV35 tone mapper; no switch. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | PsychoV35 UI brightness | the menus' and HUD's white, in steps of 1 | none (the paper white) | 203 nits | dimmer or brighter UI, the scene unchanged | helps (#843) | 203 (BT.2408's reference white, the mod's) | | PsychoV35 color space | Vanilla, BT.709, DCI-P3 | none (the game's matrix) | BT.709 | the mod's colour space | helps (the mod's default) | BT.709 | | PsychoV35 midgray | Render or Vanilla mid grey | none | Vanilla | as the mod | helps | Vanilla | | PsychoV35 match tone slope | the game's slope at mid grey | none | On | as the mod | helps | On | | PsychoV35 tone slope, hue clip emulation | the mod's, 0 to 100 | none | 50 | as the mod | helps | 50 | | PsychoV35 exposure | the scene at mid grey | none | 100% | brighter or darker scene | helps | 100% | | PsychoV35 highlights, shadows, contrast, saturation | the mod's grading, 0 to 100 | none | 50 | as the mod (contrast 0 breaks the picture, as in the mod) | helps | 50 | | PsychoV35 bloom | the bloom's strength | none (the game's) | 50 | 0 none, 100 twice the game's | helps | 50 | | PsychoV35 reset all | every row back to the mod's defaults | none | a button | resets | helps | — | ## Testing **Tested:** `python -I -B tests/run_all.py` on Windows 11: the same 68 failures as on `main @ 544229a2`, all of them environment ones (listed below), nothing new. `tests/test_psychov35.py` compares the header with RenoDX's path on 5518 colours and gradings; `tests/scene_tonemap_ir.cpp` checks the bank, the adapted gain, the bloom and the scene's scale; `tests/output_encode_ir.cpp` checks the encoder against RenoDX's in double, in each colour space and three UI whites. In the game (RTX 4090, Windows 11, Native HDR, PsychoV35, DLSS), side by side with the mod (ReShade, zelda-oot-oz at its defaults): every row changes the picture at once and "reset all" brings the defaults back; Hyrule Castle Town at night, the same warm torch and lantern light, the same bloom, the same colours in each colour space and the same UI brightness as the mod; Lon Lon Ranch alley, child Link, the camera moved back and forth: no warm/cool or brightness jump (#344's place). Contrast at 0 gives a broken picture, as the mod's does (test35.hlsl divides the purity by the contrast); left as the mod has it. <details><summary>The 68 checks that fail on main @ 544229a2 and here alike (this PC's environment: a compiler name it lacks, a CRLF checkout, tools not installed)</summary> `nx2/test_mesh_first_types.py`, `tests/test_alt_enter.py`, `tests/test_audio_deadline.py`, `tests/test_audio_output_errors.py`, `tests/test_audio_wave_buffer_release.py`, `tests/test_bc_levels.py`, `tests/test_bind_memo.py`, `tests/test_capture_copy_helpers.py`, `tests/test_collect_wide.py`, `tests/test_cpu_report.py`, `tests/test_dlss_actor.py`, `tests/test_dlss_checks.py`, `tests/test_dlss_math.py`, `tests/test_draw_binds.py`, `tests/test_env_file.py`, `tests/test_failed_compile_keeps_objects.py`, `tests/test_finish_output.py`, `tests/test_fps_overlay_order.py`, `tests/test_fps_rate.py`, `tests/test_fps_stats.py`, `tests/test_framegen_auto.py`, `tests/test_framegen_gate.py`, `tests/test_fsr3_math.py`, `tests/test_gpu_choice.py`, `tests/test_hd_rumble.py`, `tests/test_import_span.py`, `tests/test_job_queue.py`, `tests/test_jobs_wait_runs_queued.py`, `tests/test_menu_mouse_scroll.py`, `tests/test_mirror_inherit.py`, `tests/test_missing_nup.py`, `tests/test_movie_upscale_policy.py`, `tests/test_nvn_texture_handle.py`, `tests/test_oot_jitter.py`, `tests/test_pass_hazard.py`, `tests/test_pool_span.py`, `tests/test_present_ahead.py`, `tests/test_present_thread.py`, `tests/test_prof_clock.py`, `tests/test_profiling_mode.py`, `tests/test_prompt_auto_face.py`, `tests/test_push_state.py`, `tests/test_quick_pipelines.py`, `tests/test_report_words.py`, `tests/test_rt_pool_minimum.py`, `tests/test_rumble_mapping.py`, `tests/test_rumble_menu.py`, `tests/test_rumble_refresh.py`, `tests/test_run_all_changed.py`, `tests/test_same_bind.py`, `tests/test_same_draw.py`, `tests/test_same_dyn.py`, `tests/test_seed_reader.py`, `tests/test_skip_code.py`, `tests/test_slow_frames.py`, `tests/test_status_line.py`, `tests/test_submitted_page.py`, `tests/test_table_track.py`, `tests/test_target_image_pool.py`, `tests/test_tested_configurations.py`, `tests/test_tex_spans_once_a_present.py`, `tests/test_texture_layout_sizes.py`, `tests/test_ub_gap.py`, `tests/test_upscale_independent.py`, `tests/test_upscale_label.py`, `tests/test_vertex_bind.py`, `tests/test_vk_swapchain_compat.py`, `tests/test_wb_pages.py` </details> **Not tested:** Linux, AMD and Intel GPUs: the change is in the translated IR and a uniform bank, nothing vendor-specific. **Must be tested:** - Linux, AMD (radv): Native HDR, PsychoV35, move each PsychoV35 row and "PsychoV35 UI brightness" in the pause menu, expecting the scene to change at once, the UI brightness to change the menus only, and no colour jump at Lon Lon Ranch (Test Farm: @Beanstalk linux amd, PsychoV35 rows change the HDR picture live) ## Risks **What could break:** the scene's colour with PsychoV35 where the game switches between its two scene permutations (#344's symptom: PR #400 gave both the same gain; this follows the mod, which treats them apart; tested at Lon Lon Ranch without a jump); the HDR output with PsychoV35 if another fragment program carried PQ's constants and 1e-4 (the pass checks the whole shape and logs why it leaves a program); bank 19 on a driver with fewer than 20 uniform buffer bindings per stage. **Turning it off:** the HDR tone mapper row on Vanilla; else revert the commit. **Compatibility:** the scene mapping and encoder programs are translated again once (the translator changed); the options file gains the rows' keys; with PsychoV35 the defaults change the colour space from the game's matrix to BT.709, as the mod's. ## Issues Fixes #843 See #344 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [ ] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. Made and published with the help of Claude Opus 5.5
feat(vk): PsychoV35 as RenoDX's zelda-oot-oz has it: its settings, its scene and its HDR output
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 7s
79a34381cf
With the HDR tone mapper on PsychoV35, the picture was RenoDX's zelda-oot-oz mod at its defaults, with
none of its settings, a scene that still differed from the mod's, a UI as bright as the paper white
(#843) and the game's own encoder matrix. Now the mod's, found in the translated IR (nothing of the
game's code is kept), its settings read live from a constant bank the renderer owns.

Settings (ir_opt/psychov35.h, scene_tonemap_pass.h; vk_menu.cpp, vk_draw.cpp uniform_range):
- the mod's rows in the Graphics tab, under HDR, in its order, as sliders, shown with Native HDR
  and PsychoV35: UI brightness, color space, midgray, match tone slope, tone slope, hue clip
  emulation, exposure, highlights, shadows, contrast, saturation, bloom, and "reset all";
- read at each draw from bank 19 (PsychoV35::kSettingsBank; MAX_CBUFS 18 -> 20): a change shows
  at once, nothing is translated again; the HDR contrast row hidden with PsychoV35 (its own
  Contrast grades the scene) and vk_framegen.cpp no longer grades the picture a second time.

Scene, as the mod's 0x09EB4538 and 0xED732BB7 with a custom tone mapper:
- the adapted permutation's local exposure left out and its blue times the exposure once more
  (the mod's native gain (g, g, g*g));
- the bloom term scaled by Bloom; the peak the HDR peak over the paper white;
- the scene in the UI's white (times the paper white over it).

HDR output, as the mod's output_0x92D6F81D (new ir_opt/output_encode_pass.h):
- the game's HDR10 encoder, found by PQ's constants and its 1e-4 in its code (vk_shader.cpp
  Code::pq_fit) and keyed with PsychoV35's programs, writes the chosen colour space's BT.2020
  light (Vanilla: the game's matrix over its white; BT.709, the default, and DCI-P3: RenoDX's
  matrices) times the UI's white, then PQ.

Tests: tests/test_psychov35.py (the header against RenoDX's path), tests/scene_tonemap_ir.cpp
(the bank, the adapted gain, bloom, the scene's scale), tests/output_encode_ir.cpp (the encoder
in each colour space against RenoDX's in double), the menu and README checks.

Fixes #843

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Tested in game: RTX 4090, driver 610.47, Windows 11, Native HDR, PsychoV35, DLSS: every PsychoV35 row changes the picture live; Castle Town at night matches RenoDX's mod side by side (colours, bloom, UI brightness, colour spaces); Lon Lon Ranch without colour jumps

Tested in game: RTX 4090, driver 610.47, Windows 11, Native HDR, PsychoV35, DLSS: every PsychoV35 row changes the picture live; Castle Town at night matches RenoDX's mod side by side (colours, bloom, UI brightness, colour spaces); Lon Lon Ranch without colour jumps
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: the author's own in-game run on Windows 11 with an RTX 4090, side by side with the mod.
  • Nothing gets worse that I know of: ticked: Measurements show GPU time and fps unchanged, and Risks states each risk with its condition.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: the author's own in-game run on Windows 11 with an RTX 4090, side by side with the mod. - *Nothing gets worse that I know of*: ticked: Measurements show GPU time and fps unchanged, and Risks states each risk with its condition.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 7s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'psychov35-look:LRF17-psychov35-look'
git switch 'LRF17-psychov35-look'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!1393
No description provided.