Greedfall 2#561
Open
RankFTW wants to merge 2 commits into
Open
Conversation
fe871ae to
f5b67ff
Compare
There was a problem hiding this comment.
Pull request overview
Adds a RenoDX-based HDR mod integration for Greedfall 2 (DX12 / Silk Engine) by injecting custom shaders and exposing runtime tuning controls via the addon settings system. The approach transports HDR through the game’s existing 10-bit intermediate by PQ-encoding, then restores/tonemaps and outputs scRGB to a float16 swapchain.
Changes:
- Introduces a Greedfall2 addon with a
ShaderInjectDataconstant buffer and a comprehensive UI/settings surface for tonemapping + grading. - Adds three replacement shaders to bypass the game’s ACES compute tonemap, PQ-encode scene/UI for transport, then decode + tonemap and output scRGB.
- Adds a local Psycho test17 tonemapper implementation and updates
.gitignorefor common build/temp/log artifacts.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/games/greedfall2/shared.h |
Defines the injected constant buffer layout and renodx macro bindings for shaders. |
src/games/greedfall2/addon.cpp |
Registers the addon, hooks shader replacements, and defines user-facing settings that drive the injected constant buffer. |
src/games/greedfall2/0x6DE32B48.cs_6_0.hlsl |
Replaces the game tonemap compute pass: keeps auto-exposure, uses PQ transport (or vanilla ACES when disabled). |
src/games/greedfall2/0xF27041D0.cs_6_0.hlsl |
Replaces compositing: applies effects, PQ-encodes UI at controlled brightness, composites using inverted alpha. |
src/games/greedfall2/0xD2C8C305.ps_6_0.hlsl |
Replaces final blit: PQ-decodes, applies grading/tonemap, outputs scRGB to the float16 swapchain. |
src/games/greedfall2/psycho_test17.hlsl |
Adds Psycho tonemapper implementation used by the final blit when selected. |
.gitignore |
Ignores MSVC build output, dumps/tmp files, and common logs/artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+376
to
+380
| renodx::utils::settings::UpdateSetting("ColorGradeFlare", 0.f); | ||
| renodx::utils::settings::UpdateSetting("ColorGradeScene", 100.f); | ||
| renodx::utils::settings::UpdateSetting("ColorTemp", 50.f); | ||
| renodx::utils::settings::UpdateSetting("ShadowLift", 0.f); | ||
| } |
Comment on lines
+108
to
+114
| } else { | ||
| // Gamma encode before ToneMapPass | ||
| hdr = renodx::color::correct::GammaSafe(hdr, true); | ||
|
|
||
| // ACES / RenoDRT via ToneMapPass | ||
| tonemapped = renodx::draw::ToneMapPass(hdr); | ||
| } |
Comment on lines
+8
to
+10
| // Game tonemaps with Narkowicz ACES in compute pass 0x6DE32B48. | ||
| // When 0x6DE32B48 is replaced, t0 contains gamma-encoded HDR/3 in R10G10B10A2. | ||
| // We decode, recover ×3, then apply ToneMapPass with real pre-tonemap HDR values. |
Comment on lines
+1
to
+6
| #ifndef RENODX_SHADERS_TONEMAP_PSYCHO_TEST17_HLSL_ | ||
| #define RENODX_SHADERS_TONEMAP_PSYCHO_TEST17_HLSL_ | ||
|
|
||
| namespace renodx { | ||
| namespace tonemap { | ||
| namespace psycho { |
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.
HDR mod for Greedfall 2 (DX12, Silk Engine).
Game renders HDR internally then tonemaps with Narkowicz ACES in a compute pass and blits to an R8G8B8A8 swapchain. No native HDR.
Replaces three shaders:
0x6DE32B48 (tonemap compute): skips ACES, PQ-encodes pre-tonemap HDR through existing R10G10B10A2 buffer
0xF27041D0 (compositing): PQ-encodes UI at controlled brightness, composites with inverted alpha
0xD2C8C305 (final blit): PQ decodes, applies ToneMapPass, outputs scRGB to float16 swapchain
Features:
ACES and RenoDRT tonemapper options
Full color grading (exposure, contrast, saturation, highlights, shadows, blowout, flare, hue correction/shift)
Independent UI brightness control
Color temperature and black floor
Auto-exposure from original shader preserved
Main menu/loading screen passthrough via on_drawn flag detection
No resource upgrades required
Notes:
Does not use RenderIntermediatePass/SwapChainPass pattern. The intermediate R10G10B10A2 buffer between the tonemap and final blit cannot be upgraded to float16 on this game's DX12 pipeline (resource cloning causes rendering corruption). PQ encoding is used as a workaround to transport HDR through the 10-bit buffer. The final blit outputs scRGB directly to the float16 swapchain. HDR10 output mode is not supported as a result — WIP.