Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDR Enhancements for God of War (2018) #40

Merged
merged 9 commits into from
Sep 20, 2024
Merged

Conversation

mqhaji
Copy link
Contributor

@mqhaji mqhaji commented Sep 17, 2024

This pull request addresses significant issues with God of War's original HDR implementation, introducing improvements in tonemapping, gamma correction, brightness control, and color grading. These changes ensure a more accurate and immersive HDR experience while offering users enhanced control over visual settings.


Key Changes

HDR Improvements:

  • Proper PQ Encoding: Replaced the game's faulty approximation curve fit of PQ with proper PQ encoding, ensuring better handling of HDR content on modern displays.
  • Gamma Correction Fix: The original HDR implementation mistakenly used sRGB gamma instead of the correct 2.2 gamma. This resulted in grayish shadows due to a mismatch in gamma, which the developers attempted to cover up using a contrast slider. This issue has now been fixed, and the gamma is correctly handled in HDR mode.

Tonemapping Options:

  • Vanilla: fully retains the original game's code with no modifications.
  • None: Uses the new code path with no tonemapper applied.
  • DICE: Uses the new code path with DICE by channel.

Adjustable Sliders:

  • Peak Brightness
  • Game Brightness
  • UI Brightness

Color Grading Sliders:

  • Exposure
  • Highlights
  • Shadows
  • Contrast
  • Saturation
  • Blowout
  • LUT Strength

Known Issue

The game writes to an rgb10a2_unorm texture at the end of the rendering pipeline. At this stage, the UI and game image is already blended, and a final scalar is applied to the entire image (one was previously applied to the final game render). This allows independent control over the game and UI brightness, as finding and editing each UI shader individually would be impractical. However, applying this scalar to an image already clamped to 10,000 nits and then tonemapping it results in a slight reduction of peak brightness as the UI brightness slider is lowered.


Additional Notes

God of War (2018)'s original HDR implementation suffered from poor handling of HDR content, including incorrect gamma (sRGB instead of 2.2), no peak brightness handling, and a poor approximation of PQ. These issues are now resolved.

The updated HDR mod has been tested extensively in various sections of the game, ensuring it enhances the visual experience while maintaining the integrity of the original artistic direction.

@clshortfuse clshortfuse merged commit d3510a2 into clshortfuse:main Sep 20, 2024
3 checks passed
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