Precise color transformation matrices #15747
Unanswered
willmtemple
asked this question in
Feature requests - Renderer
Replies: 1 comment
|
This sounds reasonable to me. It's a shame we can't use the CTM from KMS, but it's probably not going to change much since we already do the final offloaded pass in hl anyways pretty much unconditionally nowadays |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What's the problem?
This issue has been reported before, but I'm proposing a specific solution for discussion. This is a problem that involves three pieces:
You notice this when using
cm = hdr/hdredidthe moment you enable a CTM. An HDR monitor using BT.2020 + PQ goes way more red than an SDR monitor, and it also gets a slight magenta cast. That is the effect of the sRGB matrix being applied to the encoded PQ values in the primaries of BT.2020.What's your proposed solution?
My proposal is for "Precise CTM" and it comes in three parts.
set_ctm_for_output_precise. This request would define the CTM to be computed in linear light, in the primaries of BT.709, with 1e-6 precision (wire format defined to be the matrix elements multiplied by 1e6 and transmitted as an integer).I have a working prototype of this pipeline including the hyprland-protocols revision, hyprsunset matrix rewrite, and in-shader CTM for Hyprland. I will post them as PRs for review and reference. I haven't dug into the DRM Color Pipeline stuff much yet (notes in attachments below).
Caveats
An in-shader CTM cannot apply to direct scanout (but when offloaded to a DRM Color Pipeline, it can work), so a precise CTM applied in-shader either blocks DS or vice versa, depending on whether the user prefers chromaticity to be consistent vs. having direct scanout when the night light is active. There could be render settings and windowrules for customization of how CTMs interact with DS and fullscreen.
Attachments
Image of the defect. Left monitor is BT.2020 + PQ running with
cm = hdredid, right is sRGB (camera white balance is targeting the window on the right monitor).DRM Color pipeline API notes (click to expand)
These ideas are based on what's on my machine specifically, need to do research about what exists on AMD/intel. Probed on NVIDIA 610.43.03, kernel 7.1.5. I'm probably wrong/confused about some of the following.
I acknowledge that:
I have searched all (open and closed) discussions and issues, checked the wiki, and my feature is not there.
I have read the Code of Conduct and agree to follow it.
I wrote this request with my own hands, my own keyboard, and in my own words.
All reactions