Nebula colors?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
The Black Albatross
Above Average
Above Average
Posts: 22
Joined: Thu Mar 10, 2011 8:24 pm

Nebula colors?

Post by The Black Albatross »

I've been fiddling around with the background settings, going for more realistic/pretty stars in my background. Putting the star count up to a high number while putting the sky_rgb_colors at very light gray and black makes some stars look close and others far away, a very nice effect.

An unwanted side effect of my experimentation, however, is that I only get red-colored nebulae—all of my systems anywhere only have nebulae of a red color.

The wiki page on planetinfo.plist tells me that sky_rgb_colors controls both star color and nebula color, and so my guess is that my attempt to limit stars to one hue (white) also ended up limiting my nebulae to one hue.

Some questions about this:
1) Is there any way I can use the plist or scripts to control nebula color and star color independently from each other? If not, is there a reason these parameters are linked as they are?
2) Why does making my stars white turn my nebulae red?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Nebula colors?

Post by JensAyton »

The Black Albatross wrote:
1) Is there any way I can use the plist or scripts to control nebula color and star color independently from each other? If not, is there a reason these parameters are linked as they are?
There hasn’t been demand for more tweak factors in this area. We won’t be adding it during the current feature freeze, but I’ve filed Feature request #5309.
The Black Albatross wrote:
2) Why does making my stars white turn my nebulae red?
Part of the work of selecting a nebula colour is done in the [Wikipedia] HSV colour space. Any pure grey has undefined hue, so the code chooses 0, which is red. To avoid this, you need to use colours with a non-zero hue, but they can be very pale.

Specifically, the algorithm for selecting nebula colours is:
  • Select a random colour by linear interpolation between the two sky colours in RGB space.
  • Convert to HSV space. For a grey value, h = 0.
  • Boost the saturation: s = 0.5s + 0.5. For a grey value, this means s = 0.5.
  • Multiply the hue by 360. (I believe this was originally a bug, but it has the desirable effect of allowing a system to have nebula hues that don’t fall on a line in RGB space.)
  • Convert back to RGB.
The Black Albatross
Above Average
Above Average
Posts: 22
Joined: Thu Mar 10, 2011 8:24 pm

Re: Nebula colors?

Post by The Black Albatross »

Very informative explanation, thanks.
Post Reply