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 and wide color range output setup. #812

Open
Paolo-Oliverio opened this issue Sep 6, 2023 · 0 comments
Open

HDR and wide color range output setup. #812

Paolo-Oliverio opened this issue Sep 6, 2023 · 0 comments

Comments

@Paolo-Oliverio
Copy link
Contributor

Paolo-Oliverio commented Sep 6, 2023

There is no way to enable HDR by api on supported platforms.
I'm conducting some initial research about how hard it is to add it.

What are the supported platforms?!?

  • Windows 10 and later versions with dx12, dx11 and Vulkan. (Baldur's gate 3 and ghost recon breakpoint supports hdr both on dx11 and Vulkan ).
  • Linux: No. It is lagging implementing hdr.
  • Switch: No. on Switch 1 is indeed impossible due to old hdmi interface.
  • OSX: It has hdr display support and metal offer hdr output, but don't know any actual implementation.
  • IOS : Maybe with Metal.
  • Android : Maybe with Vulkan (limited to few brands and chipsets???).
  • PS4 pro PS5 : Yes don't know details.
  • XBOX series : Yes as for Windows through dx12 plus some games featuring dolby vision.
  • Future Platforms: Ideally in future every platform will support hdr of some kind.

A proper solution will provide in kinc just the bare minimum to enable it without direct calls to platform specific code.
hdr has some requirements about render target formats, metadata generally set on the swapchain and comes with tools for propert tone mapping and color management.
while the metadata and render target setup are something kinc could provide, shaders and other high level code should be provided by the user.
Ideally a sample could be made in kha and or kore to show a mvp implementation of the full pipeline.A minimal sample could simply render a raw hdr texture to screen with no further processing just to evaluate the visual parity with hdr image viewer.

hdr could be enabled for any arbitrary Color-Space or some platforms/graphic apis enforce/limit the color-space choice?
is there something to set at a low level to enable certain color-spaces on specific platform/api?

Formats enabling hdr provide:

  • Color: RGB or YCbCr (luminance chroma)
  • Ranges: in integer from 8 10 and 12bit or 255 1023 4095 colors per channel full or limited (especially used in video to adjust white and black levels)
  • Gamma : 1.0 , 2.2 and ST.2084 (Perceptual Quantization or PQ)
  • Primaries : BT.601, BT.709, BT.2020 ( source directx manual) where is P3 isn't it commonly used ?!?
  • Transfer Matrix : same as primaries ?!?

Basic color setup is sRgb BT.709 primaries no wide color gamut, but still better than sdr due to 10bit.
Usual output render target format are:
10 10 10 2 for hdr10
16 16 16 16 for scRGB

Implementation Specifics:

Open issues :

  • How format variety changes among other graphic apis?
    Is there a minimum set of formats that every platform/ graphic target supports?
  • Can we come up with an unified metadata abstraction?
  • Is dynamic metadata possible like in hdr10+ and dolby vision?
    • I guess it is not possible e.g. hdr10 display itching on metadata change.
      Dolby Vision for games(some xbox titles seems to feature it e.g. gears5).
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

1 participant