Page 1 of 1

Atmosphere Code

Posted: 18.10.2008, 18:17
by Rassilon
Im not sure what Im doing here so maybe some of you who are more familiar can point me in the right direction... I am trying to use the new atmosphere code to generate the nicer atmosphere effects to no avail... I seem to be able to botch something somewhat close but it seems I am unable to figure out the right specs for a smooth gradient... I end up with a sharp edge on entry into the atmosphere the higher the sky the sharper the edge... I am assuming this was made more for smaller planets than large Jovian ones...

Here is what I am working with so far...

Code: Select all

   Atmosphere {
      Height 500
      Lower [ 0.43 0.2 0.5 ]
      Upper [ 0.26 0.1 0.4 ]
      Sky [ 0.4 0.1 0.0 ]
      Sunset [ 0.0 0.1 0.3 ]

      Mie 0.0001
      MieAsymmetry -0.25
      Rayleigh [ 0 1 0 ]
      MieScaleHeight 120
   }


The higher I set green the more it dissapears it seems still leaving a small edge of it the higher I go... Of course I would like the sky color to show up and it does the lower I set the green color... So I think I am not calculating this correctly... If anyone can set me in the right direction it would be greatly appreciated!

Re: Atmosphere Code

Posted: 18.10.2008, 20:13
by t00fri
Ras,

Mie theory refers to scattering of light on atmospheric droplets etc. Some knowledge about it's physical background is required in order to arrive at a more or less controlled parameter tuning. Unfortunately, I am too busy for writing a tutorial about it.

Anyway, your Rayleigh settings ar WAAAAAY to big!

But we have a long thread at CelestialMatters, for example:

http://forum.celestialmatters.org/viewt ... 6&start=75

I also have given there pretty much improved settings for Earth in particular. Here it is:

EARTH:
----------

Atmosphere
{
...
Mie 0.0050
MieAsymmetry -0.35
Rayleigh [ 0.0008121 0.0020775 0.00375 ]
Absorption [ 0.00057 0.0004 0.0 ]
MieScaleHeight 15
}

I did not spend much time to improve the Mars settings
My values produce a nice blue sunset, though!
Here is what I use for Mars:

MARS:
-------

Atmosphere
{
Sunset [ 0 0 1.0 ]
MieScaleHeight 10
Mie 0.0014
MieAsymmetry -0.15
Rayleigh [ 0.0010 0.0006 0.0003 ]
Absorption [ 0 0.004 0.005 ]
}

Most people who tried them, liked my Earth settings, in particular.

Fridger

Re: Atmosphere Code

Posted: 18.10.2008, 20:52
by Rassilon
Yeah I ended up fiddling more and found out that

MieScaleHeight - controls the height of the atmosphere and
Mie - Controls the cutoff point of the gradient

In a visual sense that is.... So the higher the height the lower the Mie and since this is float you cannot go past 4 decimal places... That is what my problem was when I set that to 0.00001 it turned completely black... under this the atmosphere appeared with an edge to it... so really you cannot go past say 500 or so MieScaleHeight until double is used in the calculations... So essentially Ive figured out how to control the colors on a basic level and now know that I cannot go past a certain height where atmospheres are concerned...

Thank you for your answer!

Re: Atmosphere Code

Posted: 19.10.2008, 03:19
by Rassilon
Ok Ill just leave my questions in here... I cant quite remember if it was added into the code or not but can emissive objects be light sources like stars? If so how is it done exactly? Currently I have coded the following as a test moon of one of my planets facing the nightside and it does not cast any light on the parent planet... So Im assuming either I do not have the proper code in the def or emissive objects do not cast light...

Code: Select all

"RAS 000-b" "RAS 000/Averiant"
{
   Class "star"
   Radius   51737.53
   Color [ 1 0 0 ]
   Emissive true

   Atmosphere {
           Height     50000.0
         Lower      [ 1 0 0 ]
        Upper      [ 1 0 0 ]
        Sky        [ 1 0 0 ]     
   }

   EllipticalOrbit {
      Period           27.321661
      SemiMajorAxis    2384400
      Eccentricity     0.054900
      Inclination      5.15
   }


   UniformRotation
   {
       Inclination        23.45
          AscendingNode       0.0
          MeridianAngle      38
   }

   Albedo           1
}

Re: Atmosphere Code

Posted: 19.10.2008, 17:53
by selden
can emissive objects be light sources like stars?
No, not yet. Not before v1.7 at the earliest.

However, as of v1.5, Stars can now orbit one another or Barycenters and have surface textures, so you can create multi-star systems.

Using v1.5.1, you could define a Star system with a Barycenter (they're invisible) with the same definition as your planet, and a Star with the orbit of your Moon. That might have the effect you want.

V1.6 will support light being reflected from one orbiting body onto another (e.g. Earthshine on the Moon)

Re: Atmosphere Code

Posted: 19.10.2008, 18:12
by Rassilon
Hmmm well theres a possibility I can make emissive objects cast light with that earthshine code i bet... We will see...

Re: Atmosphere Code

Posted: 19.10.2008, 18:22
by Guckytos
Hi Rassilon,

you can also change the shape of a star completely by adding a mesh to it. So you could build a flying ISS star in the orbit around earth :lol:

Just take a look at my STC guide, perhaps you will have some real nice ideas of how to make use of these commands.

Regards,

Guckytos

Re: Atmosphere Code

Posted: 19.10.2008, 19:32
by Rassilon
Ok well models might be pretty neat... Might prove to make some bizarre looking stars that would drive Fridger nuts LOL like a green bumpy star hehe... Or a model of a unicorn being sucked into a black hole!

I just would love to see the ability to change the color of stars as well as the color of the light they project... which would prove to be useful for the many classes of stars we currently have in the spectrum...

Re: Atmosphere Code

Posted: 22.10.2008, 01:46
by Reiko
Those MIE settings are very confusing. I've read all the threads about it but still can't make a tan colored sky. It was only by accident from randomly playing with the numbers that I was able to make a green atmosphere.

Re: Atmosphere Code

Posted: 22.10.2008, 15:27
by Rassilon
Reiko wrote:Those MIE settings are very confusing. I've read all the threads about it but still can't make a tan colored sky. It was only by accident from randomly playing with the numbers that I was able to make a green atmosphere.

I think Ive grasped the beginnings of this code... I was able to repoduce a tan atmosphere with the following...

Code: Select all

   Atmosphere {
           Height     50.0
                 Lower      [ 0.5 0.2 0 ]
        Upper      [ 0.5 0.2 0 ]
        Sky        [ 0.5 0.2 0 ]
      Sunset     [ 0 0.2 0.5 ]
     
         Mie              0.001
         MieAsymmetry    -0.25
         Rayleigh   [ 0.0005 0.0002 0.0000 ]
         Absorption [ 0.0030 0.0060 0.0100 ]
         MieScaleHeight 20.0
   }


Mie is relative to MieScaleHeight if you use MieScaleHeight of 2 digits use a Mie of 0.001... 3 digits use 0.0001 etc... You may have to play some with those numbers... But you see where Im heading with this...

MieAsymmetry to me the easiest way to wrap your head around it is to say the lower MieAsymmetry is the more contrast between midday and sunset there will be... A lower value of say -0.25 gives you less of a bright sunset but dulls your colors on midday so you have to add to Rayleigh to compensate...

As you can see I sort of matched Rayleigh with my sky colors... Take note of this... Absorption is the opposite it takes color away... By tweaking the values you should be able to produce any color sky you wish... Even some suprising colors along the way...

Now Im working on figuring out how to manifest the proper sunset color...

Also let me add you do not need the sky colors when using the new atmosphere code it is only for those who choose not to render using the new atmosphere code... Leaving it out has no affect... This includes Sky, Lower and Upper...

Re: Atmosphere Code

Posted: 22.10.2008, 15:39
by t00fri
Don't forget to look up CelestialMatters!

At CM, we have a LONG thread about Mie atmospheres, entitled
Manifestations of Atmospheric Light Scattering (Mie Theory)
:
http://forum.celestialmatters.org/viewt ... sc&start=0

It also contains the physical meaning of the Mie parameters in Celestia and plenty of examples of sunsets like blue ones on Mars...

http://forum.celestialmatters.org/viewt ... c&start=75

Fridger

Re: Atmosphere Code

Posted: 22.10.2008, 16:17
by Reiko
Rassilon wrote:
Reiko wrote:Those MIE settings are very confusing. I've read all the threads about it but still can't make a tan colored sky. It was only by accident from randomly playing with the numbers that I was able to make a green atmosphere.

I think Ive grasped the beginnings of this code... I was able to repoduce a tan atmosphere with the following...

Code: Select all

   Atmosphere {
           Height     50.0
                 Lower      [ 0.5 0.2 0 ]
        Upper      [ 0.5 0.2 0 ]
        Sky        [ 0.5 0.2 0 ]
      Sunset     [ 0 0.2 0.5 ]
     
         Mie              0.001
         MieAsymmetry    -0.25
         Rayleigh   [ 0.0005 0.0002 0.0000 ]
         Absorption [ 0.0030 0.0060 0.0100 ]
         MieScaleHeight 20.0
   }


Mie is relative to MieScaleHeight if you use MieScaleHeight of 2 digits use a Mie of 0.001... 3 digits use 0.0001 etc... You may have to play some with those numbers... But you see where Im heading with this...

MieAsymmetry to me the easiest way to wrap your head around it is to say the lower MieAsymmetry is the more contrast between midday and sunset there will be... A lower value of say -0.25 gives you less of a bright sunset but dulls your colors on midday so you have to add to Rayleigh to compensate...

As you can see I sort of matched Rayleigh with my sky colors... Take note of this... Absorption is the opposite it takes color away... By tweaking the values you should be able to produce any color sky you wish... Even some suprising colors along the way...

Now Im working on figuring out how to manifest the proper sunset color...

Also let me add you do not need the sky colors when using the new atmosphere code it is only for those who choose not to render using the new atmosphere code... Leaving it out has no affect... This includes Sky, Lower and Upper...


t00fri wrote:Don't forget to look up CelestialMatters!

At CM, we have a LONG thread about Mie atmospheres, entitled
Manifestations of Atmospheric Light Scattering (Mie Theory)
:
http://forum.celestialmatters.org/viewt ... sc&start=0

It also contains the physical meaning of the Mie parameters in Celestia and plenty of examples of sunsets like blue ones on Mars...

http://forum.celestialmatters.org/viewt ... c&start=75

Fridger

Thank you guys for your help, I do read the threads but am too dumb to understand what is being discussed. I've been part of this community for two years now and just figured out a few months ago my old graphics card supports openGL 2.0.
I am the asian version of a kelly bundy so forgive me if I ask for a dumbed down version if one of you guys make a detailed tutorial on the mie atmosphere code.

Re: Atmosphere Code

Posted: 22.10.2008, 17:27
by Rassilon
t00fri wrote:Don't forget to look up CelestialMatters!

At CM, we have a LONG thread about Mie atmospheres, entitled
Manifestations of Atmospheric Light Scattering (Mie Theory)
:
http://forum.celestialmatters.org/viewt ... sc&start=0

It also contains the physical meaning of the Mie parameters in Celestia and plenty of examples of sunsets like blue ones on Mars...

http://forum.celestialmatters.org/viewt ... c&start=75

Fridger

Yes this helped me alot thanks!
I was trying to explain it for those who dont understand all the in-depth explanations therein...