Page 1 of 3

Sky Colors Gamma Correction

Posted: Wed May 11, 2022 9:57 am
by another_commander
These two shots show the exact same location while running ZygoUgo's Cinematic Skies OXP, but you can probably notice a difference with the sky rendering.

Image

Image

The first shot shows the sky as we currently have it. The second one involves an experimental change in the sky rendering code which enables gamma correction also for the sky objects, i.e. stars and nebulae.

I am fully aware that some will prefer the darker skies and that probably includes myself too. However, the correct sky colors should be the ones in the second shot - gamma correction is already performed on both ship objects and planets, after all. As you can see, it is possible to have bright nebulae too and the colors are much more vivid. Notice also how stars appear brighter in the second shot. Anyway, since there are quite a few OXPs which change nebulae and those could maybe break or display funny if the sky rendering changes, I think I will hold off committing any code for now. What I will do instead, is post a test build here and let you Windows users take it for a drive and see what you think for yourselves.

Drop the exe in your oolite.app folder (backup original exe first), then edit your .GNUstepDefaults (backup original first) and add this line:
"skycolor-gamma-correct" = YES;
to activate the feature.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 11:42 am
by Cody
Thankee Admiral - grabbed. I'll give it a whirl tonight.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 2:28 pm
by Cmdr Wyvern
I have a couple of nebula packs in my collection, and before this, the nebula are very dim, almost unnoticeable.

With this applied, the nebula comes alive.
I have a reason to splurge on a new ship's camera. :mrgreen:

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 3:15 pm
by Cody
Sunrings (from last week):

Image

Sunrings (with patch applied):

Image

So far, I think that gets a thumbs up! Note the subtle change in star colours though.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 5:50 pm
by Cholmondely
It seems to be impossible to tweak "gamma" on the AppleMac. But there are contrast buttons on the top of the keyboard...

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 5:58 pm
by another_commander
Cholmondely wrote: Wed May 11, 2022 5:50 pm
It seems to be impossible to tweak "gamma" on the AppleMac. But there are contrast buttons on the top of the keyboard...
Gamma correction is something completely different to the gamma settings found on monitor panels or computer keyboards. In very (and I mean very) simple and brief terms, gamma correction is an adjustment applied to displayed colors in order to be presented to the user as they should really appear. You could say that your monitor is lying to you and this is really what we are correcting for.

If you want to learn more, a good resource is here: https://learnopengl.com/Advanced-Lighti ... Correction
and here: https://www.cambridgeincolour.com/tutor ... ection.htm .

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 6:35 pm
by Nite Owl
Without Patch.

Image

With Patch.

Image

The nebula and stars with the patch are quite dynamic. My only question is how to suppress the OXP Verifier messages that are popping up in Mr. Latest Log with the patch in use. My guess would be that the patch's .exe is forked off the latest developer version and not the latest release version.

Cody: How are you getting those Sun Rings?

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 6:52 pm
by another_commander
Nite Owl wrote: Wed May 11, 2022 6:35 pm
The nebula and stars with the patch are quite dynamic. My only question is how to suppress the OXP Verifier messages that are popping up in Mr. Latest Log with the patch in use. My guess would be that the patch's .exe is forked off the latest developer version and not the latest release version.
Yes, the patch is forked off the latest dev version, not 1.90. Not sure which OXP Verifier messages you are getting, though.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 7:06 pm
by Cody
Nite Owl wrote: Wed May 11, 2022 6:35 pm
Cody: How are you getting those Sun Rings?
To be honest, I'm not entirely sure! It might be something I've tweaked long ago in my personal planetinfo.plist, or the fact that some stars have more intense/larger coronas than others, or a combination of OXPs - but who knows.



@another_commander: the lack of star colours has me scratching my head - any ideas?

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 7:11 pm
by another_commander
Cody wrote: Wed May 11, 2022 7:06 pm
@another_commander: the lack of star colours has me scratching my head - any ideas?
Yes. The star colors are still there, but with the gamma correction they now become brighter and start getting closer to white. You can check that the colors are still present if you take a screenshot and lower its gamma in Gimp or similar image processing s/w.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 7:17 pm
by Cody
another_commander wrote: Wed May 11, 2022 7:11 pm
The star colors are still there, but with the gamma correction they now become brighter and start getting closer to white.
O-kay... so would the gamma correction (if added to core) be adjustable/tweakable?

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 7:23 pm
by another_commander
Cody wrote: Wed May 11, 2022 7:17 pm
O-kay... so would the gamma correction (if added to core) be adjustable/tweakable?
Yes, I believe initially it would (or should) be tweakable as in yes-I-want-it / no-forget-it kind of choice. But what you could try to do is, find which OXP is this that generates these star colors and maybe try to edit them in its planetinfo.plist to darker values to compensate for the brightening of the gamma correction. Told you, some things might look funny sometimes, especially if we are used to how they have looked for years, which is why this feature is not in just yet.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 7:26 pm
by Cody
<nods> I'll have a gander at Keeper Sky, which I think is responsible for those star colours.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 7:38 pm
by another_commander
@Cody: For Keeper Sky, try these values for sky_color_1 and sky_color_2:

Code: Select all

sky_color_1 = (0.33,0.45,1.0);
sky_color_2 = (1.0,0.61,0.13);
I cannot test, but theoretically these should completely revert the effect of the gamma correction on stars. Give it a try and see if this helps.

Re: Sky Colors Gamma Correction

Posted: Wed May 11, 2022 8:19 pm
by Cody
<disappears down rabbit hole of tweakage - emerges, a little shaken> Result! Those numbers worked, but 'twas my butchered version of Zygo Sky.

Image

Thankee, Admiral - yet another drink or three I owe you!