"Clean" Gamma correction (updated)

"Clean" Gamma correction (updated)

Postby Rachael » Thu May 10, 2018 11:39 pm

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
You do not have the required permissions to view the files attached to this post.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: "Clean" Gamma correction

Postby Graf Zahl » Fri May 11, 2018 12:37 am

It would be nice if this could also be applied to the internal gamma calculation for OS-controlled fullscreen gamma.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: "Clean" Gamma correction

Postby Pixel Eater » Sat May 12, 2018 12:29 am

It looks good, I've always thought that low gamma made things look faded :)
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: "Clean" Gamma correction

Postby Rachael » Sat May 12, 2018 12:48 am

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.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: "Clean" Gamma correction

Postby Nash » Sat May 12, 2018 2:40 am

Rachael, that looks much better than the usual F11 stuff. Would love to see it as a built-in GZDoom feature :D
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: "Clean" Gamma correction

Postby Rachael » Sat May 12, 2018 3:43 am

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. ;)
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: "Clean" Gamma correction

Postby SiFi270 » Mon Jun 25, 2018 5:18 am

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.
User avatar
SiFi270
 
Joined: 10 Feb 2015
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Postby Rachael » Mon Jun 25, 2018 9:40 am

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.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: "Clean" Gamma correction

Postby SiFi270 » Mon Jun 25, 2018 10:47 am

It still looks the same after doing that, even when I switched to another map and restarted the program.
You do not have the required permissions to view the files attached to this post.
User avatar
SiFi270
 
Joined: 10 Feb 2015
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Postby Rachael » Mon Jun 25, 2018 11:10 am

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?
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: "Clean" Gamma correction

Postby SiFi270 » Mon Jun 25, 2018 12:00 pm

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.
User avatar
SiFi270
 
Joined: 10 Feb 2015
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Postby Rachael » Mon Jun 25, 2018 1:18 pm

Try this one, instead. It's simply "gamma2" cvar - nothing more.

Don't use the other cleangamma shader with this one.
You do not have the required permissions to view the files attached to this post.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: "Clean" Gamma correction

Postby SiFi270 » Mon Jun 25, 2018 1:51 pm

That one works, thanks.
User avatar
SiFi270
 
Joined: 10 Feb 2015
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Postby Rachael » Mon Jun 25, 2018 3:04 pm

Thank you. I'll update the original post. I like this one, better, anyhow.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Shaders

Who is online

Users browsing this forum: No registered users and 0 guests