r/HDR_Den • • 5d ago

Game Mod Fix for Windows SDR content when using HDR

https://github.com/SERGEYDJUM/dwm_eotf_rs

A good fix for SDR content if you plan to use HDR on Windows for daily use.

120 Upvotes

52 comments sorted by

6

u/_chiponurshoulder 5d ago

Does this affect games?

6

u/filoppi HDR Dev 5d ago

No. Only in windowed mode.

1

u/Rivdoric 5d ago

Sorry. I don't really understand the answer.

Does this mean only desktop use or does this mean windowed borderless (which is the default win11 behaviour for games) SDR games will be fixed ?

3

u/pulley999 5d ago

It only affects applications composited by the windows DWM. Borderless fullscreen games, because of Fullscreen Optimizations, are not composited by the DWM.

Basically, if the game is the exclusive thing on the monitor, even if borderless windowed, it doesn't fix it. If there's some other windows element being drawn overtop, say, the start menu, it does.

1

u/Rivdoric 5d ago

Much Thanks. So this means that playing an SDR video on a fullscreen video player also won't fix anything ? 👀

2

u/pulley999 5d ago

For most video players it should actually fix it. They usually aren't subject to FSO which typically tends to be only games using directx present calls. That said, some video players will trigger FSO.

5

u/Ozzyh26 5d ago

Does this affect video playback? I'm wondering about rtx HDR video compatibility specifically as I like using it for YouTube.

4

u/ElectroMoe 5d ago

It says this in the repository

You do not need to disable/revert the patch (or restart DWM) when playing HDR games or videos. It only affects DWM composed SDR content!

2

u/ky7969 5d ago

You have to set a flag in your browser to use sRGB only. Im not sure if RTX HDR video will still be able to use it or not though

1

u/Ozzyh26 5d ago

Would simply disabling rtx HDR allow this to take its place? Still not clear if it's applying to video playback or not.

1

u/ky7969 5d ago

If I remember, I’ll try it tonight when I get home from work. I already have this installed and have been using it for a few days

-5

u/itsTyrion 5d ago

TIL people actually use RTX HDR? I've tried it and it's genuinely worse than a 2016 "reshade" with bloom cranked to 11

3

u/Supr3me187 5d ago

it is actually decent if you calibrate the middle greys and the contrast according to your peak brightness. But you might have to use third party software like Nvidia inspector for that.

2

u/elvnmagus 4d ago edited 4d ago

I use rtx hdr for videos. You are right, you have to set middle grey appropriately in the rtx hdr settings panel. You also have to set a lower peak brightness in rtx hdr's sliders too, depending on your display, or it will mess up SDR colors (SDR's 8 bit highlights) and whites will crush. Still way better than sdr range using those levels though, so worth it.

On my G6 I use middle grey 50 -52 which keeps the normal scene 220 to 250nit (which is good in regard to persistent logos and frames for OLED), but i set the peak slider to 1200nit in rtx hdr. I also set the windows HDR panel's Desktop SDR brightness slider to 21 for ~200 nit, or 31 to 37 for 220 to 250 nit, so that static desktop, apps, interfaces (outside of rtx injected videos or real HDR material) stay pinned there.

900nit crushes whites even less though. Lower bitrate/comprssed material on youtube can still muddy colors together somewhat at times, lacking detail in color in some clothing for example. depending on the scene, but that's just how it is.

I suspect a lot of people just crank settings and blow everything out (SDR's 8 bit highlights). My G6 hss a way higher peak in actual HDR material but rtx hdr would look tertible if I set it that high.

2

u/Davepen 5d ago

Wait what? No it's not?

Do you actually have a HDR monitor?

If you don't have a HDR monitor (and HDR enabled in Windows) RTX HDR isn't gonna do shit.

0

u/itsTyrion 5d ago

Uh yeah of course. hdr1000 certified, ~1350 peak in calibration. Everything almost white / bright enough gets weirdly boosted by like 200 nits and it just looks OFF. also some colors.

2

u/Davepen 5d ago

That's weird.

It looks pretty decent to me (better than Auto HDR at least), but it does require a bit of tweak.

Mid-Gray: 44

Contrast: +25

Saturation: -25

1

u/Crimsongekko 5d ago edited 5d ago

yeah these are correct, I also have it on minimum max brightness i.e. 400 at most times to avoid UI or pure white background being blindingly bright

at 400 max brightness you can just leave it always enabled and forget about tweaking it, only time I might want to temporarily disable it is if some YT video is showing tweets or something with pure white background but that's a very rare coccurrence

sometimes I'll crank up the max brightness to 800 which is my monitor's peak if I'm watching something that I know it works well with, in general I wouldn't recommend going over 1000 nits for this kind of sdr to hdr reverse tonemapping

7

u/chr0n0phage 5d ago

I’ve had HDR enabled for 4 years without turning it off in my LG C2, SDR content slider at 31. Do these just handle SDR better? Haven’t needed to fix anything.

2

u/korzasa 3d ago

Gamma curve is incorrect for SDR content when windows HDR is toggled on. Don't worry about it though if you haven't noticed. Funnily enough on displays that crush blacks (commonly older OLEDs) it may actually look better that way with mismatched gamma

1

u/chr0n0phage 3d ago

Is this a monitors thing? SDR/HDR mode in Windows looks the same for SDR interface elements on this C2 and a friends S95D. I've heard of it being real bad on monitors, however.

1

u/korzasa 3d ago

No, my understanding is that the mismatch exists regardless of display when HDR is toggled on. It certainly is a thing on both my Monitor and TV LG G5

1

u/chr0n0phage 3d ago

Well, I have other machines that are SDR only using SDR only displays. Windows desktop / interface elements look exactly the same as my main machine connected to a C2 that hasn't had HDR turned off in 4 years. So, its not that I haven't noticed, its that there is no visible difference in a stare and compare. Nothing to fix I guess.

1

u/TimidVulcano 4d ago

Is this equivalent to this windhawk mod? https://windhawk.net/mods/dwm-eotf-gamma

1

u/bug_ikki 3d ago

I actually migrated to this windhawk mod since its more stable for me. dwm_eotf_rs flickers between gray and dark on youtube firefox.

3

u/Milk_Cream_Sweet_Pig 5d ago

This one is a life saver. Back then i just tolerated the washed out look of SDR content and used RTX HDR on SDR videos so it wouldn't look washed out like everything else. Having 2 monitors, it was kind of a pain to toggle between the two. This app came in clutch.

3

u/Shorkan 5d ago

So guys, I'm being serious, I don't know if my eyes are broken or something but I have HDR ON in Windows 24/7 and, other than some backgrounds showing incorrect blacks (with different spots showing different levels of black as they were clearly not made with HDR in mind), I simply can't see any issue. I definitely don't have washed out colors or anything like that.

I do have RTX HDR on for videos, and I play all games with RenoDX or whatever HDR implementation I can find.

But things like Firefox or the content I see on it look perfectly fine. I can open a photo, whether on Firefox or in my image viewer, and move it between my HDR OLED screen and the IPS one without HDR and they look basically the same. What am I missing?

3

u/pulley999 5d ago

The washed out blacks ARE the issue this fixes. Windows uses the wrong EOTF curve for mapping SDR content and it lifts near black tones by up to ~20% perceptually. Microsoft used the paper bt.709 spec which uses the piecewise sRGB EOTF curve with a linear rolloff at the bottom where the near-black tones are. In practice, that sort of thing is a bitch to build into firmware so every monitor for decades used a pure power EOTF (gamma 2.2) instead. Almost all SDR content was mastered on this pure power 'pseudostandard' and not on the official paper spec Microsoft is using to do their tonemapping.

1

u/Lodowczyk 4d ago edited 4d ago

Not bt.709 spec. That spec is for video only. Microsoft uses sRGB standard. The problem is the standard itself is ambiguous on what curve to use for encoding/decoding. Some argue srgb should only be used for encoding and the image should go straight to the display using gamma 2.2. Others argue for encoding and decoding with piecewise gamma which creates a lift on 2.2 monitors. Microsoft went with the second option

1

u/pulley999 4d ago edited 4d ago

Whether or not the monitor is 2.2 is irrelevant because HDR display out doesn't use 2.2, or 2.4, or sRGB. It does PQ or HLG (usually PQ for computer monitors.) Microsoft's internal function maps SDR content using the sRGB EOTF to a subset of HDR color space and outputs it in an HDR container to a display using HDR present standards.

What it does do is create a lift in any SDR content that was mastered on a 2.2 SDR monitor. Which, as mentioned, was the overwhelming majority of monitors for nearly 30 years, thereby meaning nearly all SDR content is negatively affected. Gamma 2.2 was far easier to implement in firmware and tracked 'close enough' to piecewise sRGB that monitor makers just used it instead, but still called it 'sRGB reference.'

Which led to this whole mess where the SDR content claims to be encoded using sRGB OETF, but had a gamma mismatch at creation time due to being mastered on a monitor decoding using Gamma 2.2 EOTF. The only way to see an overwhelming majority of SDR content as it was intended is to preserve that display chain gamma mismatch that was baked into the content.

On modern monitors that do use proper piecewise sRGB EOTF for their SDR presentation it won't look lifted compared to the HDR mode on the same monitor, but that's because the monitor's SDR presentation is also lifting the accidentally gamma mismatched content in the same way. It's still wrong, even if correct on paper.

Given that this issue only really started to be addressed after HDR was becoming mainstream, the mismatch that was used industry-wide for nearly 30 years should just be codified as the standard at this point. SDR is already on its way out, the standard will increasingly only be used for legacy content, and trying to force it to be correct now just fucks up the overwhelming majority of SDR content ever made.

1

u/Lodowczyk 4d ago edited 4d ago

Srgb piecewise gamma was created BECAUSE it was better for software. Pure law gamma creates math problems near 0 value which piecewise curve fixes. Gamma 2.2 was and is used in monitors because that is close to the response of CRT monitors and because that is a good gamma for bright office environments not because it tracks close enough to piecewise gamma. The sRGB standard assumes the display is pure 2.2 gamma because according to the creators of said standard monitors were never supposed to follow piecewise response curve. Yes in HDR mode the monitor being 2.2 is irrelevant because gamma is not used but what I wrote is why the lift happens now. Its because microsoft uses srgb standard with encode and decode using piecewise gamma. As for content being mastered on miss matched gamma that only applies to non managed applications really because in color managed applications with a properly profiled and calibrated screens there is and was no miss match. In reality windows in HDR now renders SDR the same way macos does. Yes I think microsoft could just change the pipeline to use gamma 2.2 but calling windows’ implementation wrong or broken is just not true because they use the standard which because is ambiguous can be interpreted in two ways

1

u/StevieBako 5d ago

RenoDX is great as it fixes more than the blackfloor raise from improper gamma curve. RTX HDR works okay for vids to an extent. In saying that, using a colour profile that correctly maps from piecewise srgb to pure power gamma 2.2 is the way to go 95% of the time as the large majority of HDR games are developed on srgb monitors using windows and most devs aren’t aware of the issue nor care. A few games are the exception and properly convert the gamma curve for instance MW4 and a few others but it’s not common. The best way to confirm this is with liliums reshade pack with the HDR analysis tool. If the game doesn’t use anti-cheat this is an easy way to see if the game has the right black floor. If you’re in a very dark spot and it looks raised to something like 0.05 or 0.1 then you use the pure power gamma curve. If it looks like it has the correct black floor, then leave the windows piecewise colour profile that the hdr calibration tool creates.

2

u/mental12 5d ago

When I used this a few weeks ago, the browser window would repeatedly flicker like between dark and gray, it was kinda annoying. It seemed like the tool was repeatedly enforcing the gamma, fighting against windows.

2

u/Davepen 5d ago

There's a fix there for chromium apps I believe.

2

u/pulley999 5d ago

It's because of how chromium handles hdr. It renders the full SDR page in SDR which gets tonemapped by windows using this function. When an HDR element comes onto the page (can even be something like an embedded advertisement or HDR social media share button) chromium immediately switches to rendering the whole page in HDR and doing its own tonemapping for the SDR bits, which uses the same broken math Windows does vanilla (so both broken appearances match.)

End result is that chromium renderers have gamma change as HDR elements enter and exit the page. There is a separate fix for this issue.

1

u/mental12 4d ago

I would like to know the fix? is it mentioned in this thread? force sRGB?

2

u/pulley999 4d ago

It's a tool called Browser Gamma Fix. Forcing sRGB works but will disable HDR web content, and force that instead to tonemap to SDR.

2

u/hansip87 5d ago

What's the difference of this and Gloam?

2

u/itsTyrion 5d ago edited 5d ago

"When HDR is enabled, almost all SDR content in Windows looks wrong and washed out, even it's own UI."
Wait, does it/is it? Looks ok to me? Unless we're talking screenshots of course

4

u/MusaQH Game Modder 5d ago

Windows displays SDR content using the piecewise sRGB gamma formula. Your monitor probably uses that in SDR hence it looking the same.

1

u/Davepen 5d ago

It looks fine, but it definitely looks slightly off.

This is a small correction, but it is quite noticeable.

1

u/Roee_Mashiah2 5d ago

Is there something similar for linux?

3

u/ky7969 5d ago

It’s not needed if you use KDE right? Doesn’t it have an automatic mode?

2

u/SnowflakeMonkey Content Creator 5d ago

Linux does 2.2 gamma in HDR 

1

u/Zenkai_9000 5d ago

Bookmarking

1

u/Plank_stake_109 5d ago

Unfortunately the chromium issue invalidates this for me.

1

u/elvnmagus 4d ago edited 4d ago

This probably wont work for me because I use a multi monitor setup and one screen isn't hdr. Correct me if I'm wrong, but I don't think this app has monitor selection capability. Not sure if it would affect the sdr screen's desktop or not if I left this on globally, with hdr disabled on that screen. Maybe hdr color profiles only on the hdr enabled monitors would be effected though, idk.

1

u/Ionlyusereddit4help 2d ago

Amazing how microslop won't fix this even after all this time

1

u/just-ti-see-this 2d ago

Need to check this after work, without hdr Samsung s90c looks dim and with hdr on some colors pop off too much.

0

u/NTClarity 5d ago

anything but pressing win+alt+B 😭

1

u/Ionlyusereddit4help 2d ago

Yes, because I don't want to have to launch a game, forget it has/doesn't have HDR, close it, toggle HDR, then launch it again