cm: higher-quality tonemapping#12204
Conversation
3df2f92 to
5e53f84
Compare
3f2aefa to
62a2099
Compare
62a2099 to
b72da6d
Compare
|
Current tonemapping is also inspired by kwin. If they changed theirs then we should probably do the same. Might be harder to track every necessary change because they combine cpu calcs, shaders and drm properties. |
|
@UjinT34 Thanks, I didn't consider that. My HDR displays are all Mini-LED, so I can't be sure how it'll look on e.g. OLEDs with HDR400. |
|
|
b72da6d to
8c958ae
Compare
|
Rebased and moved to a more general HDR-to-SDR check to use transfer function luminances for tonemapping across the board. This change makes the improved tonemapping apply to HDR content on SDR displays too, instead of just in screenshare. If Auto-HDR might cause apps to always output HDR, this should make things look okay when you're un-fullscreened and back to SDR. |
8c958ae to
db6a676
Compare
|
Updated to fix a slight blue-green hue I noticed for HDR->SDR. |
|
lgtm |
Describe your PR, what does it fix/add?
Inspired by KWin. Updates the tonemapper to use the
srcimageDescription's luminance info instead of throwing it away. Also scales the reference luminance to match that of the destination, preventing over-bright screenshots / recordings.Also tossed in a quick fix missed from #12094, which prevents overly-dark screenshares in SDR when
render:cm_sdr_eotf> 0.HDR screenshot tonemapped to SDR:

SDR screenshot:

Without these changes:

I considered a simple luminance multiplier as a proof-of-concept when getting started. This is what that would look like by keeping the current

tonemapand simply multiplying the end result by80.0 / 203.0:Versus this PR:
The changes to

blurprepare.fragfix the inverted color issue with blur from SDR->HDR.Screenshot of my desktop in SDR:
And in HDR tonemapped back to SDR with these changes:

The blur is still too strong, but the colors are a lot better.
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
I'm not super confident in the "correctness" of tonemapper changes (really just looked at prior art), but it does improve HDR screenshares immensely.
Is it ready for merging, or does it need work?
Ready for merging