Galaxy colors etc.

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Galaxy colors etc.

Post #1by t00fri » 14.06.2005, 22:14

Hi all,

my Steinicke precision NGC|IC catalog now includes lots of additional "goodies", like several optimized, advanced distance determinations etc (SBF, redshift...). There are 10600+ galaxies with accurate J2000 parameters (!) in the file! All orientations work beautifully! I have tested very many indeed directly against DSS photos. Note, two more additional galaxy templates: S0 and SBb are required!

A great feature of the present galaxy catalog is it's uniform galaxy distribution wrto North and South hemispheres!

That's how it looks:

Image

also all J2000 positions have been directly fitted to the DSS RealSky photographs!

The rest of my transscribed revised RC3 catalog has another 15000+ entries ;-) , but Steinicke's NGC|IC catalog should be good enough for a start. The most messy task in my Perl script was actually to translate the extended galaxy type syntax with its many exceptions and additions to the simple Hubble classification we are using in galaxy.cpp!

We indeed have to work hard on new culling techniques. ;-) : The NGC|IC catalog reduced my rates from
>95 fps to ~25 fps. The rest of the RC catalog gets the performance down to < 10 fps!

A typical entry in my new deepsky.dsc file looks like this

Code: Select all

# Revised NGC and IC Catalog, Wolfgang Steinicke, April 5, 2005
# http://www.ngcic.org/steinicke/default.htm
# augmented by
# Revised 3rd Reference Catalog of Bright Galaxies (RC3,VII/155)
# http://cdsweb.u-strasbg.fr/viz-bin/Cat?VII/155
# augmented by
# The SBF Survey of Galaxy Distances. IV.

# SBF Magnitudes, Colors, and Distances,
# J.L. Tonry et al., Astrophys J 546, 681 (2001)
#
# Today's Hubble constant = 72 [km/sec/Mpc]  (WMAP 2005)
# Adapted for Celestia with Perl extraction script: gal2dsc.pl Revision: 1.00
# Processed 2005-6-12 0 162 0 15:51:24 UTC
# by Dr. Fridger Schrempp, fridger.schrempp@desy.de
# ------------------------------------------------------

# NGC 1  / UGC 57  / MCG 4-1-25  / ZWG 477.54
Galaxy "NGC 1"
{
#
# D =   1.70'  d =   1.20'       Position Angle = 120.00 deg's
# Inclination    =  49.30 deg's  V_mag =  12.80  B_mag =  13.60
# Distance from Hubble law using:  v_rad_CMB =  4218.00 km/sec
#
        Type  "Sb"
        InfoURL  "http://simbad.u-strasbg.fr/sim-id.pl?Ident=NGC 1"
        RA            0.1208
        Dec          27.7089
        Distance   1.911e+08
        Radius     4.725e+04
        Axis     [    0.0781     0.9082    -0.4112]
        Angle       197.1490
}
...

+ 10600+ further galaxies ;-)

Each entry has also an infoURL line such that a single mouse click loads the corresponding DSS RealSky photo!

For testing purposes you'll notice quite a few additional /commented out/ parameters displayed in my galaxy entries...

+++++++++++++++++
As soon as Chris reports back to me with his new shader code etc., I shall do eventual final adaptations of my data to his code and then RELEASE it for further testing.
+++++++++++++++++


As to galaxy.cpp, I also did some work about galaxy colors there: I implemented a routine that takes H,S,V color parametrizations as input and outputs the corresponding R,G,B values (between 0 and 1). The Hue is in degrees (0<H<360) while S and V are between 0 and 1.

MAC OS fans, find the Galaxy::hsv2rgb() method at the end of my post for eventual implementation into galaxy.cpp.

It's application in galaxy.cpp is about like so in the method 'InitializeForms()'

Code: Select all

{
   // build color table:

   for (unsigned int i = 0; i < 256; ++i)
   {
     float rr, gg, bb;         
     float h = i<80+10*Mathf::sfrand()?17.0f:243.0f;
     Galaxy::hsv2rgb( &rr, &gg, &bb, h, 0.14f, 0.91f );    <===========
     colorTable[i]  = Color( rr,gg,bb);
   }

Its very easy to model galaxy colors this way from catalog entries, due to the great advantages of the HSV parametrization over RGB in our case!

Fix V from the catalog's Vmag, make the color saturation S (universally!) proportional to the observer's distance from the galaxy and take e.g. two (smeared) values for the Hue in the core and the outer regime (see example!) . The above simple parametrization gives e.g. for M 91 THIS:


Image

Bye Fridger

Code: Select all

-----------------------------
void Galaxy::hsv2rgb( float *r, float *g, float *b, float h, float s, float v )
{
// r,g,b values are from 0 to 1
// h = [0,360], s = [0,1], v = [0,1]

   int i;
   float f, p, q, t;

   if( s == 0 ) {
       // achromatic (grey)
       *r = *g = *b = v;
   return;
   }

   h /= 60;            // sector 0 to 5
   i = floor( h );
   f = h - i;            // factorial part of h
   p = v * ( 1 - s );
   q = v * ( 1 - s * f );
   t = v * ( 1 - s * ( 1 - f ) );

   switch( i ) {
   case 0:
     *r = v;
     *g = t;
     *b = p;
     break;
   case 1:
     *r = q;
     *g = v;
     *b = p;
     break;
   case 2:
     *r = p;
     *g = v;
     *b = t;
     break;
   case 3:
     *r = p;
     *g = q;
     *b = v;
     break;
   case 4:
     *r = t;
     *g = p;
     *b = v;
     break;
   default:   
      *r = v;
     *g = p;
     *b = q;
     break;
   }
}
Last edited by t00fri on 15.06.2005, 10:52, edited 4 times in total.

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #2by dirkpitt » 14.06.2005, 23:44

Wow, the screenshot looks fantastic. This is like another quantum leap over the previous purple, monochromatic galaxies
(which I thought already looked great).

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Re: Galaxy colors etc.

Post #3by ElChristou » 15.06.2005, 01:19

t00fri wrote:...The NGC|IC catalog reduced my rates from
>95 fps to ~25 fps. The rest of the RC catalog gets the performance down to < 10 fps!...


I was afraid of that...

This color technic seems really promising :D ... Some improvement in the blobs placements and the modeling of those galaxies will be really extra...

Tx for the good work.

Bye
Image

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #4by jestr » 15.06.2005, 01:30

Yeah,looks great guys-cant wait to try it out,Jestr

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #5by ElChristou » 15.06.2005, 13:30

What about adding a big smooth blob to give the general tint?

Image

(this is only a quick test...)
Image

lukr
Posts: 40
Joined: 16.04.2005
With us: 19 years 7 months

Post #6by lukr » 15.06.2005, 13:37

The big blob theory looks good to me!

lukr
Posts: 40
Joined: 16.04.2005
With us: 19 years 7 months

Post #7by lukr » 15.06.2005, 13:39

The big blob theory looks good to me!

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #8by t00fri » 15.06.2005, 13:50

ElChristou wrote:What about adding a big smooth blob to give the general tint?



Sorry ElChristou,

I dont understand and I also can't see much of a difference among the
two lefthand images. Don't forget we are not doing image
manipulation by means of some fancy software here, but rather are
constraint do do things /automatically/ in the existing code and most
importantly to do things LIGHTENING FAST! Otherwise with >10000
objects to render we shall never finish ;-)

As I explained, using H,S, V color "coordinates" (instead of R,G,B), we
can describe the typical galaxy parameters most directly as needed.

By keeping S, H fixed and varying V, I can adjust the
brightness of the object without changing anything else.

By keeping V, H fixed and varying S, I can adjust the color
saturation
such that I can start with a grayscale galaxy at very
large distance that becomes increasingly colored when we get closer.
Yet the coloration spectrum always remains the same. This distant
dependent Saturation function would be /universal/ for all galaxies!

By keeping V, S fixed and varying H, we can describe the inner
and outer galaxy colors pretty well, just with two (smeared) values of
H. These we directly infer from the color values given in the catalog!

Could you explain once more what was in your mind instead?

Thanks,

Bye Fridger

Tosv
Posts: 26
Joined: 14.02.2005
With us: 19 years 9 months
Location: Hudiksvall, Sweden

Post #9by Tosv » 15.06.2005, 14:08

Maybe the arms should be polished a bit, according to the galaxy photo the arms are thinner, or more wide spread, and a little "diffuse". Maybe a few small blobs could be inserted between the arms as well. Now those areas are almost empty. Is it possible or would this slow down the rendering too much?

The colors are nearly perfect. It certanly looks promising! :) Good job! I wish I could do things like that.
Windows XP
AMD Sempron +2600 (1,83 MHz) CPU
VIA/S3 UniChrome Integrated
Celestia 1.4.0 Pre6

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #10by t00fri » 15.06.2005, 14:38

Tosv wrote:Maybe the arms should be polished a bit, according to
the galaxy photo the arms are thinner, or more wide spread, and a
little "diffuse". Maybe a few small blobs could be inserted between the
arms as well. Now those areas are almost empty. Is it possible or
would this slow down the rendering too much?

The colors are nearly perfect. It certanly looks promising! :) Good job!
I wish I could do things like that.


First of all, you should realize that in this project the rendering
philosophy for galaxies has changed dramatically: we are not talking
anymore about rendering "by hand" selected galaxies, but rather the
issue is to render many thousands of them automatically just
from using existing catalog data!

All these thousands of galaxies that occur e.g. in 7 spiral types
classified by Hubble need to be rendered in shape via one of 7
corresponding template images. While M91 in the picture above has
somewhat thinner arms than our template, other SBb type galaxies
might have thicker ones. Get the point?

The actual form of the galaxay template used for a given spiral Hubble
galaxy type can be modiified|improved any time with some simple
code written by Toti. The program is called bmp2pts. You take a nice
face-on spiral galaxy of a certain Hubble type from some source,
switch to grayscale, adjust its orientation properly as the code wants it
(by rotating the image appropriately), cut it to 128x128 size and then
vectorize it by means of bmp2pts into a file with x,y,x points and an
intensity distribution. These files are read in by the Celestia code for
each one of the 7 spiral Hubble types S0, Sa,Sb,Sc,SBa,SBb,SBc.

So far I did not invest lots of efforts to generate optimal galaxy
templates. There is considerable room for improvements. These can
be done without recompiling Celestia, in fact. Unfortunately, Toti's
program is a bit tricky in practice....

Bye Fridger

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #11by ElChristou » 15.06.2005, 16:04

toofri wrote:I dont understand and I also can't see much of a difference among the two lefthand images.

... really? I know I keep it subtle but I think we can see the differnce...

Don't forget we are not doing image manipulation by means of some fancy software here, but rather are constraint do do things /automatically/ in the existing code and most importantly to do things LIGHTENING FAST! Otherwise with >10000 objects to render we shall never finish

Yes, I have well understood this... in fact your HSV coordinates are pretty perfect for the task, and my post above was more about the stucture of the galaxy by Toti...

The actual form of the galaxay template used for a given spiral Hubble galaxy type can be modiified|improved any time with some simple
code written by Toti. The program is called bmp2pts. You take a nice
face-on spiral galaxy of a certain Hubble type from some source,
switch to grayscale, adjust its orientation properly as the code wants it
(by rotating the image appropriately), cut it to 128x128 size and then
vectorize it by means of bmp2pts into a file with x,y,x points and an
intensity distribution. These files are read in by the Celestia code for
each one of the 7 spiral Hubble types S0, Sa,Sb,Sc,SBa,SBb,SBc.

So far I did not invest lots of efforts to generate optimal galaxy
templates. There is considerable room for improvements. These can
be done without recompiling Celestia, in fact. Unfortunately, Toti's
program is a bit tricky in practice....


Here is part of the response, I was just asking about adding a big smooth blob to improve the coloration zone (not the colors themselves) but I realize it won't be possible because this will be an improvement from a top view, but not from side as the blob still a circle... at less the blob still aligned in the ecliptic of the galaxy...
Image

Tosv
Posts: 26
Joined: 14.02.2005
With us: 19 years 9 months
Location: Hudiksvall, Sweden

Post #12by Tosv » 15.06.2005, 16:27

Hi Fridger!

Yes, I have been following the discussions about this new mass-rendering of galaxies and I??m aware that every galaxy is unique and that it would be impossible to fine-tune every one of them by hand. I was mostly curious if there was a way to do this automatically by some kind of already existing parameters describing the thickness etc. of the arms for each galaxy. Unfortunately my English is far from good when it comes to describe and ask this kind of scientific questions. Thanks for the explanation btw, now I think I can see the complete picture. Keep up the good work :)
Windows XP

AMD Sempron +2600 (1,83 MHz) CPU

VIA/S3 UniChrome Integrated

Celestia 1.4.0 Pre6

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #13by t00fri » 15.06.2005, 16:38

Tosv wrote:Hi Fridger!

Yes, I have been following the discussions about this new
mass-rendering of galaxies and I??m aware that every galaxy is unique
and that it would be impossible to fine-tune every one of them by
hand. I was mostly curious if there was a way to do this automatically
by some kind of already existing parameters describing the thickness
etc. of the arms for each galaxy. Unfortunately my English is far from
good when it comes to describe and ask this kind of scientific
questions. Thanks for the explanation btw, now I think I can see the
complete picture. Keep up the good work :)


Hi Tosv,

The way modern catalogs do differentiate is by using a much finer
subdivision of the galaxy classification scheme than what we employ so
far in Celestia. We use the classical Hubble classification. With the
newer extended classiifications such differences could partially be
accounted for. Yet one would need an extra template image for each
eaxtended subclass....which seems to show inflationary tendencies ;-)


So sticking to Hubble seems like the best compromise at present.


Bye Fridger

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #14by ElChristou » 15.06.2005, 20:35

t00fri wrote:...I also can't see much of a difference among the
two lefthand images....

I've just come over this post on a pc in a cybercoffe waiting for my wife, and it's true that if the room is too enlighten, the 2 pics are quite similar... With a darker ambient, you will see with better clarity what I mean in the above post...

Yet one would need an extra template image for each eaxtended subclass....which seems to show inflationary tendencies


For now this represent how many class/subclass?
Image

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #15by t00fri » 15.06.2005, 22:42

Hi all,

after some further coding in galaxy.cpp, I thought I
prepare some graphical illustrations of what can be done
with the HST -> RGB routine above in Toti's patch.

Imagine H,S,T just being an alternative kind of coordinate
system in color space besides the familiar R,G,B
coordinates.

It's quite similar to polar coordinates (r, theta,phi) as
compared to x,y,z cartesian coordinates. Some of you will
remember e.g. from Highschool math that polar
coordinates are a great simplification if you have to deal
with systems that exhibit /spherical symmetry/.

In a similar fashion the H,S,V coordinates are just "custom"
tailored for our galaxy coloration task! My hsv2rgb
method above translates between these two color
coordinate systems.

First illustration:

Saturation (S) proportional to 1/distance from galaxy.


We all agree that our eye cannot make out colors if the
light intensity reaching it is too weak. So it's a great effect
if we start off with grayscale rendering of galaxies very far
away and gradually increase the coloration when getting
closer.

This effect I now have coded into galaxy.cpp. It just
requires variation of S ~ 1/distance, while in R,G,B
coordinates we would have to fine tune always 3 RGB
color values precisely
!

Here is the result of approaching a galaxy (M91)
Image

Isn't it a neat effect? Of course all this can be optimized in
various ways. These are just some first experiments...

Next illustration: Keep H and S constant and set V
from the Vmag (visual magnitude parameters) in the
galaxy catalog. This gives the desired changes in
brightness, while the color profile remains ~untouched.

Image

So far so good ;-)

Bye Fridger

guest jo
Posts: 126
Joined: 01.04.2004
With us: 20 years 7 months

-

Post #16by guest jo » 16.06.2005, 10:39

deleted
Last edited by guest jo on 19.08.2005, 17:15, edited 1 time in total.

Buzz
Posts: 264
Joined: 31.01.2002
With us: 22 years 9 months
Location: The Netherlands

Post #17by Buzz » 16.06.2005, 17:49

Hello Fridger,

Let me first express my admiration of what you are creating, it looks amazing!
I have a remark though about your idea of changing the colour or brightness depending on the distance. I remember a discussion about brightness of nebulas, that I think is also applicable to galaxies. The conclusion was that the brightness will not increase when one travels closer to the nebula, because the surface area increases at the same rate r^2 as the total brightness. Don't you think that is a valid point?

Buzz

Edit: hm, I think the angle doesn't change like r^2 after all. But the increasing apparant area should still be taken into account.

julesstoop
Posts: 408
Joined: 27.03.2002
With us: 22 years 8 months
Location: Leiden, The Netherlands

Post #18by julesstoop » 16.06.2005, 18:00

I have a feeling you are right here. After all, our own milky way doesn't look brighter than for instance the Andromeda nebula.
Lapinism matters!
http://settuno.com/

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #19by t00fri » 16.06.2005, 21:32

Certainly a good point. Let me explain, how I see the situation here. This includes part of an email I just wrote to Chris in a similar context. It may also serve as a response to what Buzz and julesstoop referred to above.

The subject appears somewhat tricky, yet I agree that in first approximation the

surface brightness = magnitude/(unit area)

is the better choice for controlling the saturation S. In addition, surface brightness is a standard galaxy catalog parameter. Hence we should read it in and use it to control S most of the time at least...

Here is how I see the situation on a more subtle level:

Color sensitivity of the human eye starts at a threshold surface brightness of about 21 magnitudes/arcsec^2. At this intensity both rods and cones are working. Clearly surface brightness(SB) and not luminosity is the determining factor for seeing color.

What makes the situation more complex is that the surface brightness is not uniform across a galaxy and that's where the distance dependence comes in. We are located in the /periphery/ of the milky way, unable to see most of its star-dense and 3d shaped core region (it would be great if we could...).

Far away from a galaxy, the effective SB is the average of the high core SB and the low peripheral SB, since our visual spacial resolution is poor. Once we are getting /close/ and eventually inside the 3d shaped core, the core SB dominates, eventually with the /whole sky/ being illuminated by an explosively growing number of /core/ stars. We could read a newspaper in the starlight. That's where I thought it was nice to turn the saturation on. In other words the standard argument of a /constant surface brightness as function of distance/ does not apply anymore when we are getting really close.

In short: the areal law has changed to a voluminal density law of illuminating light sources...

Chris wrote:The shader is coming along nicely. I'll send you some screen shots tonight....

In fact, I'm wondering what the view from a planet
inside an elliptical galaxy would look like. Just a slight brightening in the area of the sky where the center of the galaxy is located?


+++++++++
As you can see, Chris is actually busy with some most intriguing 3d graphics! coding ;-) .
+++++++++++

So here comes what I wrote in that context.

Unlike spirals, elliptical galaxies are mostly not 2d pancakes but rather 3d spheroids. The starlight is predominatly and quite uniformly /redish/ since ellipticals are old.

As to the effects on an "inside" observer's sky, see also my respective remarks above. As soon as we are really inside a spheroidal galaxy, the total light influx from the galaxy will cover 4Pi of solid angle, i.e the whole sky. Given the spheroidal galaxy geometry , all light sources in the 3d spheroidal volume around the observer will contribute to illuminate the sky and will dramatically increase the effective luminosiy/sky area!

Since the core region of spiral galaxies is also about /spherical/ unlike their /pancake/-shaped periphery,
I expect these effects to be similar inside the core of spirals.

Hence surely, I expect quite dramatic differences as compared to being 'outside', with the galaxy just covering an /areal/ fraction in the sky decreasing like 1/d^2, such that the /surface brightness/ = magnitude/unit area remains ~constant.

Bye Fridger

Toti
Developer
Posts: 338
Joined: 10.02.2004
With us: 20 years 9 months

Post #20by Toti » 16.06.2005, 22:25

Fridger,

The HSV setup is a promising approach; I think we could add some custom hue variation to some individual objects just by adding a new parameter to the galaxy entry:

Code: Select all

Colorgradient [24 56 165 12 234]

would provide in this case 5 hue values to define the custom color table at regular steps.
Perhaps we could script-extract this info from the DSS RealSky imagery.

Fridger wrote:Once we are getting /close/, the core SB dominates, eventually
with the /whole sky/ being illuminated by an explosively growing number of
/core/ stars. We could read a newspaper in the starlight.

In the current code the bulge of spiral galaxies tends to disappear as the observer gets closer (this is good: it saves buffer overdraw). Until now, I though this could
be considered a loose approximation to the surface brightness constness; but
it may be completely un-physical.
Should we modify this behavior? How does all this apply at different FOVs?

Bye


Return to “Celestia Users”