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

Add HDR support to DX11 Capture #61

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ktaeleman
Copy link

Add R16G16B16A16_Float support to the DX11Capture, allowing capturing of Windows HDR desktops (and games).
This change switches the use of DuplicateOutput to DuplicateOutput1, which enables capturing of non B8G8R8A8 buffer formats.

This also fixes the washed out and incorrect colors that were being passed to Hyperion when using a HDR format. A good example of this is Orange, which always resulted in Yellow.

Notes:

  • To make DuplicateOuput1 work, the correct dpi awareness context needs to be set, else DXGI will fail with NOT_SUPPORTED.
  • There is some strangeness I could not figure out where the 16bit floats in the captured buffer range from 0.0f to 4.6f, instead of 0 to 1. This is corrected by an arbitrary sqrt(x/4.6) formula, which ends up giving good results.

Screenshot of preview in Hyperion:
image

@ktaeleman ktaeleman marked this pull request as ready for review January 13, 2023 00:37
@pho084
Copy link

pho084 commented Jan 13, 2023

woa nice!
i have since switched to piccap (LG TV webOS capture) but will check this out!
thank you

@tihoangyeudau
Copy link

tihoangyeudau commented Mar 5, 2023

I got the issue "Texture format R10G10B10A2_UNorm is not supported" when using Radeon rx 570 graphic card with your commit (nvidia and intel are ok with yours). Please fix it!

tihoangyeudau

This comment was marked as duplicate.

@tihoangyeudau
Copy link

@ktaeleman Is it necessary to add something like this?

// Duplicate the output
            Format[] DesktopFormats = { Format.R16G16B16A16_Float, Format.B8G8R8A8_UNorm, Format.R10G10B10A2_UNorm };

@r3vEngIT
Copy link

just wanted to say that this is working great so far with the HD108 strip. thank you.

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.

4 participants