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

Does this work with native Vulkan applications? #2

Closed
Calinou opened this issue Jul 23, 2023 · 3 comments
Closed

Does this work with native Vulkan applications? #2

Calinou opened this issue Jul 23, 2023 · 3 comments

Comments

@Calinou
Copy link

Calinou commented Jul 23, 2023

The README mentions:

Under normal conditions, this ReShade shader requires Lilium's DXVK fork, which is able to force games to use scRGB (RGBA16F) textures as internal render targets and output, this allows for 3 things:

As I understand it, does this mean this shader can work with native Vulkan applications? I'm interested in using it with Godot 4's Vulkan renderer, which internally renders in HDR (RGBA16F1) but currently doesn't support HDR output.

Footnotes

  1. This is for the Forward+ rendering method. The Mobile rendering method uses RGB10A2 instead to minimize bandwidth usage, but most high-end desktop games are expected to use Forward+ (and you can force it with a CLI argument if a game defaults to Mobile).

@Filoppi
Copy link
Owner

Filoppi commented Jul 23, 2023

Yes, if you force a native Vulkan app to output on a RGBA16F buffer and set linear sRGB as color space (scRGB), which AFAIK are supported on both Linux and Windows, you will get an HDR window capable of displaying colors above 80 nits (in other words, colors beyond 0-1).
Theoretically on Windows, a window and swapchain created by Vulkan wouldn't be to output an HDR image, though both the Nvidia and AMD drivers AFAIK create a DX12 swapchain on top of the Vulkan one to enable HDR compatibility both when in windowed or fullscreen mode.

So basically what you can do is keep the previous SDR rendering pipeline, render in sRGB with gamma applied (both on the 3D rendering and the UI layer), and then convert the image back to linear space just before copying it in the swapchain buffer.
If you apply the "AutoHDR" part of my shader, you will be able to extract some fake HDR brightnesses from it, based on user selected values.
As long as the intermediary buffers have a high bit depth, none of this shouldn't result in any additional banding.

@Calinou
Copy link
Author

Calinou commented Jul 23, 2023

Theoretically on Windows, a window and swapchain created by Vulkan wouldn't be to output an HDR image, though both the Nvidia and AMD drivers AFAIK create a DX12 swapchain on top of the Vulkan one to enable HDR compatibility both when in windowed or fullscreen mode.

NVIDIA defaults to DXGI indeed, though you can force native Vulkan presentation in the NVIDIA Control Panel. I don't remember hearing about AMD doing this though.

@Filoppi
Copy link
Owner

Filoppi commented Jul 23, 2023

You might also want to check out this PR for Dolphin that added HDR support and did something similar to what I mentioned above:
dolphin-emu/dolphin#11850

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

No branches or pull requests

2 participants