Page 1 of 1

"Clean" Gamma correction (updated)

PostPosted: Thu May 10, 2018 11:39 pm
by Rachael
One of the most beautiful things about lower gamma settings in any game is not only the contrast that it brings to an image, but how it seems to make the image more vibrant.

Unfortunately, it's simply not feasible to play every game at the default or lower gamma settings - gamma correction was introduced in order to make it possible to play the game in conditions where it would be otherwise impossible to see darker spaces. However, if you are correcting external light, the results look rather garish indeed. The image looks quite washed out, even though it really is not, because it brings up lower colour channels that may not have been intended to be brought up so high.

Spoiler: Uncorrected Scene

Spoiler: Gamma Correction 2.0


So - what this mod attempts to do is restore some of the colour vibrancy so that gamma correction looks better. While it doesn't magically make Doom playable with a sun glare on your monitor, it still looks a hell of a lot better when you try to correct it:

Spoiler: "Clean" Gamma Correction 2.0


This version is controlled by "gamma2" - nothing more. Simply set gamma2 to your desired gamma value.

gamma2.pk3


Spoiler: Old version

Re: "Clean" Gamma correction

PostPosted: Fri May 11, 2018 12:37 am
by Graf Zahl
It would be nice if this could also be applied to the internal gamma calculation for OS-controlled fullscreen gamma.

Re: "Clean" Gamma correction

PostPosted: Sat May 12, 2018 12:29 am
by Pixel Eater
It looks good, I've always thought that low gamma made things look faded :)

Re: "Clean" Gamma correction

PostPosted: Sat May 12, 2018 12:48 am
by Rachael
Pixel Eater wrote:It looks good, I've always thought that low gamma made things look faded :)

That's why I made this. :)

Graf Zahl wrote:It would be nice if this could also be applied to the internal gamma calculation for OS-controlled fullscreen gamma.

Ever since I saw you post this, I've been thinking about it, and it certainly seems doable if I am willing to write my own window compositor. But now that we're on the subject, I've been thinking of doing that anyway, for other reasons, and it may be possible to have it all work on top of (and in cooperation with) DWM.exe.

Re: "Clean" Gamma correction

PostPosted: Sat May 12, 2018 2:40 am
by Nash
Rachael, that looks much better than the usual F11 stuff. Would love to see it as a built-in GZDoom feature :D

Re: "Clean" Gamma correction

PostPosted: Sat May 12, 2018 3:43 am
by Rachael
Thank you, Nash, I appreciate it, but there's a reason why I distributed this as a mod rather than as an internal feature. I have no idea how it will perform on a true OpenGL 3.3 card and I have no interest in absolutely murdering someone's frame rate on one of those.

I have a feeling I know why you said that, though, and if I am correct, then the answer is yes. ;)

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 5:18 am
by SiFi270
I'm not sure if things have always been like this or if an update to GZDoom's caused it, but when this is loaded parts of blood decals are black for some reason.

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 9:40 am
by Rachael
This mod will attempt to counteract GZDoom's internal gamma correction. If it is a hardware gamma, it will be very inaccurate and will not look quite right. GZDoom introduced a post-processing gamma correction, which this mod works better against.

Change "vid_hwgamma" to 1 for this shader to work best, since it will catch the display texture while the pixels are still floats, before they become screen-space integers.

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 10:47 am
by SiFi270
It still looks the same after doing that, even when I switched to another map and restarted the program.

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 11:10 am
by Rachael
What are the values of these CVARs?

gl_cleangamma
gamma
vid_brightness
vid_saturation
vid_contrast

Also are you using other things, like multisampling? SSAO? Supersampling? etc?

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 12:00 pm
by SiFi270
Rachael wrote:gl_cleangamma

1
gamma

1
vid_brightness

8.19564E-09
vid_saturation

1
vid_contrast

1
Also are you using other things, like multisampling?

Off
SSAO?

Couldn't find that in the menu. Checking the wiki for something related I could enter into the console also didn't get any results.
Supersampling? etc?

Ditto.

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 1:18 pm
by Rachael
Try this one, instead. It's simply "gamma2" cvar - nothing more.

Don't use the other cleangamma shader with this one.

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 1:51 pm
by SiFi270
That one works, thanks.

Re: "Clean" Gamma correction

PostPosted: Mon Jun 25, 2018 3:04 pm
by Rachael
Thank you. I'll update the original post. I like this one, better, anyhow.