Page 1 of 1

Star colors from temperature

Posted: 11.01.2007, 16:32
by makc
searching on my own I came down to celestia-1.4.1\src\celengine\starcolors.cpp where it jumps to http://www.vendian.org/mncharity/dir3/blackbody/ where, in its turn, following is said:
These values show color chromaticity (hue and saturation), but ignore brightness.
what code handles that, or does celestia simply use RGB values from StarColors_Blackbody_2deg_D65 table to plot stars?

p.s.: StarColors_Enhanced is commented as "Approximate colors used by older versions of Celestia", I would like to know how were these values obtained, thanks.

p.p.s.: reading further at http://www.vendian.org/mncharity/dir3/b ... erent.html and http://www.vendian.org/mncharity/dir3/b ... eters.html one can come to conclusion that RGB values vary pretty much and constant color values should rather be stored in XYZ without any conversions done to them; then, one could calculate whitepoint based on Y values in the whole picture and then do conversion (this would lead to stars normally fading out when you're getting closer to some bright star or planet and, I think, if implemented properly, could cancel any need for users to manually adjust magnitude limit (I mention this because I once tried to do cel script zooming in from outside of Milky Way down to Earth, and it was very annoying to adjust that limit here and there :roll: )).

Posted: 11.01.2007, 17:12
by symaski62

Re: Star colors from temperature

Posted: 11.01.2007, 17:22
by chris
makc wrote:searching on my own I came down to celestia-1.4.1\src\celengine\starcolors.cpp where it jumps to http://www.vendian.org/mncharity/dir3/blackbody/ where, in its turn, following is said:
These values show color chromaticity (hue and saturation), but ignore brightness.
what code handles that, or does celestia simply use RGB values from StarColors_Blackbody_2deg_D65 table to plot stars?

Yes, Celestia just uses colors from this table.

p.s.: StarColors_Enhanced is commented as "Approximate colors used by older versions of Celestia", I would like to know how were these values obtained, thanks.


I simply chose values that I thought looked right. There's obviously an opportunity to do something more sophisticated here based on how the human eye responds to the blackbody colors.

--Chris

Posted: 11.01.2007, 17:27
by makc
oops I edited my post without realizing that it has been answered (see above)

abusing edit button again: I do realize that full-blown XYZ support might be an overhead, but I think at least some sort of pre-computed RGB->RGB correction based on Y value would be worth of having.

Posted: 11.01.2007, 17:43
by makc
Now when I tracked it down to Renderer::renderBodyAsParticle() I see this is a bit more complicated than just a color thing, right :? I will experiment a bit and get back with something, if anything, tomorrow......