Gamma messed up upon closing GZDoom for the first time

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Gamma messed up upon closing GZDoom for the first time

Re: Gamma messed up upon closing GZDoom for the first time

by Rachael » Wed Jan 23, 2019 4:17 am

With the complete removal of the system gamma setter, this should no longer cause problems. Closing.

Re: Gamma messed up upon closing GZDoom for the first time

by Rachael » Sat Jan 19, 2019 8:21 am

https://github.com/coelckers/gzdoom/pull/712

Fixed via pull request. I would prefer this to be approved for the 3.7.2 release, if possible, but I'm doing it this way to ensure that I've done it correctly. I can assert that this works correctly in Windows, so far, that I tested. I did not find any related calls in the Mac code, so I don't know how it works there - so I did not touch the Mac code at all for this. (edit: created a new version that has the same edit on all 3 platforms)

Re: Gamma messed up upon closing GZDoom for the first time

by Rachael » Sat Jan 12, 2019 1:01 pm

I'm not talking about removing any CVARs. I'm just talking about a CVAR that would block all calls to SetDeviceGammaRamp or any other related functions.

It might be better to simply fix it to not call that function on exit if vid_hwgamma somehow currently disables gamma, though. OpenGLFrameBuffer::SetGamma() has a bool for useHWGamma that can be used to check for this condition - it should not touch the gamma if it's already been reset, previously, or if it has never been touched in the first place.

Re: Gamma messed up upon closing GZDoom for the first time

by Jekyll Grim Payne » Sat Jan 12, 2019 7:56 am

I actually do not use NVidia settings. I.e. in Nvidia Control Panel it's set to be controlled by the system. I only mentioned in it as an example of software that can be used to control gamma. I can achieve the same with native Windows color calibration settings.

upd: I do use Windows gamma settings though, because my monitors don't have any kind of gamma adjustment (only brightness/contrast), and that gamma doesn't look right at all. So GZdoom seems to restore Windows gamma to default.

Re: Gamma messed up upon closing GZDoom for the first time

by Graf Zahl » Sat Jan 12, 2019 6:57 am

That CVAR won't get removed. I have no issues with it on my Windows 8.1 system. But its default should be changed to 0, if this really shows issues on Windows 10.

This may be removed when the industry finally moves to panels with higher color resolution even for low end displays, but as long as they are still selling 6 bit with dithering it is not a working proposition to compromise the output.

From what I remember in the past, with my previous monitor, the NVidia gamma control does not integrate well with the system's gamma management, they were frequently at odds with each other and that monitor was dark enough that I couldn't use it without color correction in the driver.

Re: Gamma messed up upon closing GZDoom for the first time

by _mental_ » Sat Jan 12, 2019 6:42 am

Rachael wrote:Is there any way to force GZDoom to never touch the gamma settings at all?
Sure, we can remove/disable vid_hwgamma CVAR (with corresponding platform-specific code) and change remaining logic to behave like it is set to 1, i.e. hardware gamma off, i.e. use a shader to do gamma correction.
While I'm fine with this change, some people may complain a lot about reduced image quality.

Re: Gamma messed up upon closing GZDoom for the first time

by Rachael » Sat Jan 12, 2019 6:01 am

Is there any way to force GZDoom to never touch the gamma settings at all? That might be worthwhile to implement, especially for more modern systems.

@ OP: I am no expert but what seems to be happening is GZDoom is reading desktop gamma settings different than what they actually are when it first starts. AFAIK this is provided by your driver. When GZDoom exits, it resets the gamma to those settings it found on startup. When you change the gamma back, it changes the settings that GZDoom gets when it starts again. Not 100% certain about this, but I am reasonably confident that it's what's happening here.

Re: Gamma messed up upon closing GZDoom for the first time

by Graf Zahl » Sat Jan 12, 2019 5:46 am

Windows's gamma setting is a bit unreliable when uses with OpenGL, the only way around it is to force shader-based gamma correction in postprocessing at the cost of slightly reduced color resolution.

Gamma messed up upon closing GZDoom for the first time

by Jekyll Grim Payne » Sat Jan 12, 2019 4:47 am

I can't help but posting it here because GZDoom is the only application that causes it and none of the suggestions I've received seem to work.

The bug: regardless of the gamma or windowed/fullscreen settings in GZDoom, whenenever I launch it (nothing happens at that stage) and then close it, my system colors get messed up.

I can reset them back to normal simply by launching any gamma software (such as NVidia Control Panel) and just changing anyhing (e.g. dragging the gamma slider and cancelling the change is enough). After that I can start GZDoom as many times as I want, before the system reset the bug won't reoccur.

I'm on Windows 10. This has been happening in all versions since I moved to W10 (which was about 3 months ago). The standard NVidia solutions (disabling Night Light, Microsoft Game Bar, whatever) have no effect; no other applications cause this gamma change.

Top