"Clean" Gamma correction (updated)

Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

"Clean" Gamma correction (updated)

Post 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][/spoiler]

This version is controlled by "gamma2" - nothing more. Simply set gamma2 to your desired gamma value.
gamma2.pk3
(1.77 KiB) Downloaded 373 times
Spoiler: Old version
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: "Clean" Gamma correction

Post by Graf Zahl »

It would be nice if this could also be applied to the internal gamma calculation for OS-controlled fullscreen gamma.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: "Clean" Gamma correction

Post by Pixel Eater »

It looks good, I've always thought that low gamma made things look faded :)
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "Clean" Gamma correction

Post 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.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: "Clean" Gamma correction

Post by Nash »

Rachael, that looks much better than the usual F11 stuff. Would love to see it as a built-in GZDoom feature :D
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "Clean" Gamma correction

Post 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. ;)
User avatar
SiFi270
Posts: 451
Joined: Tue Feb 10, 2015 2:51 am
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Post 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.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "Clean" Gamma correction

Post 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.
User avatar
SiFi270
Posts: 451
Joined: Tue Feb 10, 2015 2:51 am
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Post by SiFi270 »

It still looks the same after doing that, even when I switched to another map and restarted the program.
Attachments
gammaproblems.png
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "Clean" Gamma correction

Post 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?
User avatar
SiFi270
Posts: 451
Joined: Tue Feb 10, 2015 2:51 am
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Post 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.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "Clean" Gamma correction

Post by Rachael »

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

Don't use the other cleangamma shader with this one.
Attachments
gamma2.pk3
(1.77 KiB) Downloaded 153 times
User avatar
SiFi270
Posts: 451
Joined: Tue Feb 10, 2015 2:51 am
Location: Does anyone put a serious answer here?

Re: "Clean" Gamma correction

Post by SiFi270 »

That one works, thanks.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "Clean" Gamma correction

Post by Rachael »

Thank you. I'll update the original post. I like this one, better, anyhow.
Post Reply

Return to “Shaders”