Red Dead Redemption 2 Vulkan Mod#604
Open
mqhaji wants to merge 30 commits into
Open
Conversation
- add 2 tonemap shaders, output shader, ui and hdr calibration shaders - add color grading sliders - add vanilla+ and vanilla+ (no display mapping) - add custom lut encoding - add unclamp lighting - add match sdr template
…or reference These shaders are not yet in use or integrated; added for archival and future development.
…ut compression - use hermite spline by max channel - use v3 highlights and shadows - change defaults - remove recommended and preserve shadow detail presets - compress to BT.709 in tonemap shaders and compress to BT.2020 in output shaders
- add srgb encoding for LUT - add 2.2 emulation - no sliders, hijacks game's peak and paper white sliders
…efaults, adjust grading
… remove srgb encoding
… in linear, fix lut encoding constants
…ift to calibration shader
…n paused, remove sliders
There was a problem hiding this comment.
Pull request overview
Adds a new RenoDX game module (rdr2vk) implementing HDR for Red Dead Redemption 2 (Vulkan) by replacing gameplay tonemapping shaders and final output shaders, while aiming to preserve the game’s SDR grading/LUT behavior.
Changes:
- Adds a new
rdr2vkaddon with injected settings (tone mapper selection, nits targets, grading/effects toggles). - Introduces shared GLSL include utilities for tonemap/LUT handling and PQ output encoding for Vulkan.
- Commits Vulkan shader replacements and their compiled SPIR-V (
VkMainentry point workflow documented in the mod README).
RenoDX review checklist
| Item | Status |
|---|---|
| PR scope and commits are tidy: mod PRs are mostly target game/mod changes plus required shared support. | Pass |
| Review comments are helpful: each issue explains the risky behavior or missing proof and suggests a concrete RenoDX pattern. | Pass |
| Defaults preserve the original/vanilla look as closely as practical; extra HDR look, contrast, saturation, or brightness is opt-in. | Needs comment |
| Preset Off/reset and Vanilla/0 behavior are clear; Vanilla/0 is not treated as full Off if grading/effects remain active. | Pass |
| The PR does not implement final-frame inverse tonemapping from a completed SDR swapchain/backbuffer. | Pass |
Tonemap/LUT shaders prove the untonemapped, neutral_sdr, and graded_sdr signals used by ToneMapPass or UpgradeToneMap. |
Pass |
ToneMapPass, PsychoV, and other tonemappers receive linear input; encoded/gamma/sRGB values are decoded before tonemapping. |
Pass |
| Vanilla LUT paths prove their domain, sampling, masks/strength/scaling, and HDR bridge/reconstruction strategy. | Pass |
Hard clips, saturate, UNORM writes, or lower-format copies do not destroy HDR range before HDR-critical work is complete, except scoped Vanilla/0 resource-clamp emulation. |
Pass |
SwapChainPass is only final output encoding for a proven intermediate, not hidden tonemap replacement, LUT reconstruction, or inverse SDR expansion. |
N/A |
| Output mode prefers HDR10/PQ with an SDR/HDR toggle; scRGB is used only for rare, justified compatibility or integration cases. | Pass |
Reviewed changes
Copilot reviewed 36 out of 57 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/games/rdr2vk/README.MD | Mod requirements and Vulkan shader compilation workflow documentation. |
| src/games/rdr2vk/addon.cpp | Implements the ReShade addon, shader replacement map, and user-facing settings/presets. |
| src/games/rdr2vk/metadata.json | Registers the mod metadata (id, deployment info, tags). |
| src/games/rdr2vk/shared.h | Push-constant layout and shader-side macros for injected settings. |
| src/games/rdr2vk/common.glsl | Shared color math (PQ, gamut conversion, gamma helpers, safe divide). |
| src/games/rdr2vk/canvas.glsl | Shared canvas/UI helpers used by the tonemap pipeline. |
| src/games/rdr2vk/perceptual_color.glsl | Perceptual color helper functions used by the enhanced tonemap path. |
| src/games/rdr2vk/tonemap/tonemap.glsl | Core tonemap/LUT encode/decode/compression + grading/display-map functions. |
| src/games/rdr2vk/tonemap/tonemaprdr2extended.glsl | Extended RDR2 tonemap curve helpers (derivatives, cubic solve, extension). |
| src/games/rdr2vk/tonemap/filmgrain.glsl | Film grain implementation used by the tonemap path. |
| src/games/rdr2vk/tonemap/tonemap_0x0C1275BE.frag.glsl | Replaced gameplay tonemap fragment shader variant. |
| src/games/rdr2vk/tonemap/tonemap_0x4205843B.frag.glsl | Replaced gameplay tonemap fragment shader variant. |
| src/games/rdr2vk/tonemap/tonemap_0x54F0BD84.frag.glsl | Replaced gameplay tonemap fragment shader variant. |
| src/games/rdr2vk/tonemap/tonemap_0x9F191B0B.frag.glsl | Replaced gameplay tonemap fragment shader variant. |
| src/games/rdr2vk/tonemap/0x809F5852.frag.glsl | Replaced tonemap-related fragment shader. |
| src/games/rdr2vk/tonemap/0x9B304112.frag.glsl | Replaced tonemap/LUT-related fragment shader. |
| src/games/rdr2vk/tonemap/0xA2ED1CB7.frag.glsl | Replaced tonemap-related fragment shader. |
| src/games/rdr2vk/tonemap/0xCD6F15F2.frag.glsl | Replaced tonemap/LUT-related fragment shader. |
| src/games/rdr2vk/tonemap/0xCF7FE0D7.frag.glsl | Replaced tonemap/LUT-related fragment shader. |
| src/games/rdr2vk/tonemap/0xDD04030E.frag.glsl | Replaced tonemap/LUT-related fragment shader. |
| src/games/rdr2vk/tonemap/calibration_image_0xB17FDFCC.frag.glsl | HDR-capable calibration image path for tone map types 1/2. |
| src/games/rdr2vk/tonemap/pause_0x2B012EDD.frag.glslx | Pause shader source present (not compiled/replaced in this PR’s shader map). |
| src/games/rdr2vk/tonemap/deadeye_0xDA9A5AA0.frag.glslx | Dead Eye shader source present (not compiled/replaced in this PR’s shader map). |
| src/games/rdr2vk/tonemap/eagleeye_0x6B9382CA.frag.glslx | Eagle Eye shader source present (not compiled/replaced in this PR’s shader map). |
| src/games/rdr2vk/tonemap/eagleeye_0xE3E0B5C4.frag.glslx | Eagle Eye shader source present (not compiled/replaced in this PR’s shader map). |
| src/games/rdr2vk/tonemap/compiled/0x0C1275BE.frag.spv | Compiled SPIR-V module for tonemap replacement. |
| src/games/rdr2vk/tonemap/compiled/0x4205843B.frag.spv | Compiled SPIR-V module for tonemap replacement. |
| src/games/rdr2vk/tonemap/compiled/0x54F0BD84.frag.spv | Compiled SPIR-V module for tonemap replacement. |
| src/games/rdr2vk/tonemap/compiled/0x809F5852.frag.spv | Compiled SPIR-V module for tonemap replacement. |
| src/games/rdr2vk/tonemap/compiled/0x9B304112.frag.spv | Compiled SPIR-V module for tonemap replacement. |
| src/games/rdr2vk/tonemap/compiled/0x9F191B0B.frag.spv | Compiled SPIR-V module for tonemap replacement. |
| src/games/rdr2vk/tonemap/compiled/0xA2ED1CB7.frag.spv | Compiled SPIR-V module for tonemap replacement. |
| src/games/rdr2vk/tonemap/compiled/0xB17FDFCC.frag.spv | Compiled SPIR-V module for calibration image replacement. |
| src/games/rdr2vk/tonemap/compiled/0xCD6F15F2.frag.spv | Compiled SPIR-V module for tonemap/LUT replacement. |
| src/games/rdr2vk/tonemap/compiled/0xCF7FE0D7.frag.spv | Compiled SPIR-V module for tonemap/LUT replacement. |
| src/games/rdr2vk/tonemap/compiled/0xDD04030E.frag.spv | Compiled SPIR-V module for tonemap/LUT replacement. |
| src/games/rdr2vk/output/output.glsl | Shared PQ UI/game encoding helpers (and peak clamping helper). |
| src/games/rdr2vk/output/output_main_0xA383C448.frag.glsl | Main output shader replacement that emits PQ for HDR modes. |
| src/games/rdr2vk/output/0x14BF23D4.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0x1B0D650C.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0x26B3FAA9.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0x6032A998.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0x76A78879.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0x7BE28339.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0x8B9C89F1.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0xBCF843ED.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/0xFCD82342.frag.glsl | Output-path shader replacement (PQ encoding path). |
| src/games/rdr2vk/output/compiled/0x14BF23D4.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0x1B0D650C.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0x26B3FAA9.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0x6032A998.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0x76A78879.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0x7BE28339.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0x8B9C89F1.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0xA383C448.frag.spv | Compiled SPIR-V module for main output replacement. |
| src/games/rdr2vk/output/compiled/0xBCF843ED.frag.spv | Compiled SPIR-V module for output replacement. |
| src/games/rdr2vk/output/compiled/0xFCD82342.frag.spv | Compiled SPIR-V module for output replacement. |
| return ApplyFilmGrainBT2020(color, xy, seed, strength, 1.0, false); | ||
| } | ||
|
|
||
| #endif // SRC_GAMES_INDYGREATCIRCLE_INCLUDE_FILMGRAIN_GLSL_ |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Summary
Adds RenoDX HDR support for Red Dead Redemption 2 using the Vulkan renderer.
The mod replaces the gameplay tone-mapping and output shaders to provide configurable HDR tone mapping while preserving the game’s original SDR color grading and LUT behavior.
Features
Dead Eye, Eagle Eye, and the pause-menu background shaders are intentionally not replaced.
Requirements
Validation
VkMainSPIR-V entry pointrdr2vkCMake target successfullyKnown issue
When holding Pause to open the map, the image can briefly appear deep fried during the transition. This appears to be a transient double gamma decode in an unmodified pause/map transition shader.