Sky Colors Gamma Correction

General discussion for players of Oolite.

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Sky Colors Gamma Correction

Post 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.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Sky Colors Gamma Correction

Post by Cody »

Thankee Admiral - grabbed. I'll give it a whirl tonight.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Re: Sky Colors Gamma Correction

Post 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:
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Sky Colors Gamma Correction

Post 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.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Cholmondely
Archivist
Archivist
Posts: 5366
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Sky Colors Gamma Correction

Post by Cholmondely »

It seems to be impossible to tweak "gamma" on the AppleMac. But there are contrast buttons on the top of the keyboard...
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Sky Colors Gamma Correction

Post 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 .
User avatar
Nite Owl
---- E L I T E ----
---- E L I T E ----
Posts: 556
Joined: Sat Jan 20, 2018 4:08 pm
Location: In The Dark

Re: Sky Colors Gamma Correction

Post 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?
Humor is the second most subjective thing on the planet

Brevity is the soul of wit and vulgarity is wit's downfall

Good Night and Good Luck - Read You Soon
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Sky Colors Gamma Correction

Post 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.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Sky Colors Gamma Correction

Post 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?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Sky Colors Gamma Correction

Post 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.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Sky Colors Gamma Correction

Post 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?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Sky Colors Gamma Correction

Post 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.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Sky Colors Gamma Correction

Post by Cody »

<nods> I'll have a gander at Keeper Sky, which I think is responsible for those star colours.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Sky Colors Gamma Correction

Post 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.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Sky Colors Gamma Correction

Post 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!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
Post Reply