Skip to content

Red Dead Redemption 2 Vulkan Mod#604

Open
mqhaji wants to merge 30 commits into
clshortfuse:mainfrom
mqhaji:rdr2
Open

Red Dead Redemption 2 Vulkan Mod#604
mqhaji wants to merge 30 commits into
clshortfuse:mainfrom
mqhaji:rdr2

Conversation

@mqhaji

@mqhaji mqhaji commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

  • Configurable HDR peak, game, and UI brightness
  • RenoDX (Enhanced) tone mapper using anchored LMS adaptation contrast
  • RenoDX (Vanilla+) tone mapper extending RDR2’s original Hable curve
  • Vanilla and SDR tone map types modes
  • SDR-matching LUT encoding and HDR-safe LUT sampling
  • Configurable contrast, gamma, saturation, highlights, shadows, and highlight saturation
  • Optional vignette, dithering, film grain, and lighting unclamp controls
  • HDR calibration-screen support
  • Purist and reset all options

Dead Eye, Eagle Eye, and the pause-menu background shaders are intentionally not replaced.

Requirements

  • Vulkan renderer selected in the game menu
  • Exclusive Fullscreen

Validation

  • Compiled all active GLSL replacements for Vulkan 1.3 with Rockstar’s required VkMain SPIR-V entry point
  • Built the rdr2vk CMake target successfully
  • Tested gameplay tone mapping, SDR LUT matching, HDR output, UI brightness, and HDR calibration behavior

Known 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.

mqhaji added 29 commits July 16, 2026 11:59
- 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
@clshortfuse
clshortfuse requested a review from Copilot July 17, 2026 02:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rdr2vk addon 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 (VkMain entry 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.

Comment thread src/games/rdr2vk/tonemap/filmgrain.glsl Outdated
return ApplyFilmGrainBT2020(color, xy, seed, strength, 1.0, false);
}

#endif // SRC_GAMES_INDYGREATCIRCLE_INCLUDE_FILMGRAIN_GLSL_
Comment thread src/games/rdr2vk/addon.cpp
Comment thread src/games/rdr2vk/addon.cpp
Comment thread src/games/rdr2vk/tonemap/calibration_image_0xB17FDFCC.frag.glsl
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants