• Print view

## Planetary Atmospheres Light Scattering

General discussion about Celestia that doesn't fit into other forums.
Topic author
FarGetaNik
Posts: 432
Joined: 05.06.2012
With us: 6 years 10 months
Location: Germany

### Planetary Atmospheres Light Scattering

Because of this threat: Whole Earth View I revisited my settings of atmosphere scattering parameters for various solar system objects. Applying some new tricks gave nice results, but I’m far from reality still. So feel free to improve the atmosphere renders

I took the data for scale height from here: Scale height but it’s difficult to apply, I didn't use the correct value always. Also I’d appreciate explanations on what the parameter actually do. Changing them gives somewhat unpredictable results, so it’s difficult to get the appearance you want.

• Height: This parameters seems useless for scatter-rendered atmospheres, but the value determines if Celestia bothers rendering the vertical profile of the atmosphere. So high values and the atmosphere shows up correctly even at high distances.
• Mie: The amount of Mie-scattered light. It gives a hazy appearance, but I don’t understand Mie theory to be honest. Pushing the value to high makes the atmosphere go crazy instead of giving a thick appearance. Low values don’t quite give a desired look of a thin atmosphere, like for Pluto.
• MieScaleHeight: Pretty much what it says. But it appears that a high value also makes the atmosphere go crazy thick instead of just scaling it vertically.
• MieAssymetry: determines the amount of forward- and back-scattered light.
• Rayleigh: The amount of red, green and blue light scattered by Rayleigh-scattering. In reality, it is proportional to (1/wavelength)^4. Using r=630nm, g=540nm and b=450nm I get relative intensities of r:g:b = 0.260:0.482:1. Also it seems Rayleigh scattering uses the MieScaleHeight parameter for scale height.
• Absorption: the amount of red, green and blue light absorbed.

Added after 4 minutes 44 seconds:
Gas giants
After finding the look I wanted, I pretty much copied it for each planet with minor adjustments. I went with a hazy atmosphere, little Mie backscattering and medium Rayleigh scattering. For the ice giants, I used a higher scale height than measured. Feel free to find a combination of parameters that works for the correct scale height.

Jupiter:

Code: Select all

`   Atmosphere   {      Height      1000      Mie      0.002      MieScaleHeight   27      MieAsymmetry   -0.1      Rayleigh   [ 0.00065 0.0012 0.0025 ]   }`

Saturn:

Code: Select all

`   Atmosphere   {      Height      1000      Mie      0.001      MieAsymmetry   -0.1      MieScaleHeight   59.5      Rayleigh   [ 0.00026 0.00048 0.001 ]   }`

Uranus:

Code: Select all

`   Atmosphere   {      Height      500      Mie      0.001      Rayleigh   [ 0.00026 0.00048 0.001 ]      MieScaleHeight   60   }`

Neptune:

Code: Select all

`   Atmosphere   {      Height      500      Mie      0.001      Rayleigh   [ 0.00026 0.00048 0.001 ]      MieScaleHeight   60   }`

Added after 4 minutes 10 seconds:
Hazy words
Venus and Titan feature thick cloud layers blocking the view from the surface. It’ll be great the find parameters that reproduce this phenomenon without a cloud texture, but I haven’t succeeded. The parameters would apply for height above the clouds, also the cloud height is much greater than the scale height. So the high cloud texture seems vastly unimpressed by atmospheric effects, which is not the case in reality. For Venus, I used the parameters of one of John Van Vliet’s addon as a start, but haven’t really improved anything. For Titan I was quite happy with my results at first, but can’t quite get what I see in Cassini images. I want the atmosphere to start at the cloud tops, so I defined a “cloud” object and gave it Titan’s atmosphere. Downside is I can’t toggle the clouds anymore… Note also that I’m using a grey cloud texture to blend with my defined color.

Venus:

Code: Select all

`   Atmosphere   {      Height      100      Mie      0.001                 MieAsymmetry   -0.1                 Rayleigh   [ 0.00001 0.0 0.0 ]                 Absorption   [ 0.00025 0.0003 0.0005 ]                 MieScaleHeight   48.5       CloudMap   "venus-clouds.*"      CloudHeight   48.5      CloudSpeed   90   } `

TItan:

Code: Select all

`   Atmosphere   {      Height      190      Mie      0.0001      MieAsymmetry   -0.25      Rayleigh   [ 0.00026 0.00048 0.001 ]      MieScaleHeight   150      CloudHeight   190      CloudSpeed   65      CloudMap   "titan-clouds.*"   }`

Titan "Cloud Planet":

Code: Select all

`Replace "Titan:Saturn VI" "Sol/Saturn"{   Texture      "titan-radar.*"   Radius      2576        Color      [ 1.00 0.88 0.57 ]   BlendTexture   true   Albedo      0.21   CustomOrbit   "titan"   BodyFrame   { EquatorJ2000 {} }   CustomRotation   "iau-titan"}"Titan Clouds" "Sol/Saturn/Titan"{   Texture      "titan-clouds-grey.*"   Radius      2780        Color      [ 1.0 0.85 0.5 ]   BlendTexture   true   Albedo      0.21   Clickable   false   FixedPosition   [ 0 0 0 ]   RotationPeriod   100   Atmosphere   {      Height      500      Mie      0.0001      MieAsymmetry   -0.55      Rayleigh   [ 0.00020 0.00036 0.00075 ]      MieScaleHeight   80   }}`

Added after 2 minutes 48 seconds:
Thin atmospheres
Pluto looking quite realistic already, but what bothers me is the Absorption ruins the color balance of my surface texture. Not much luck with Triton yet, but I don’t have any references. I’d just like to see a faint haze.

Pluto:

Code: Select all

`   Atmosphere   {      Height      130      Mie      0.0001      MieAsymmetry   -0.4      Absorption   [ 0.000300 0.000300 0.00000 ]      MieScaleHeight   60   }`

Triton:

Code: Select all

`   Atmosphere   {      Height      22      Mie      0.0001      MieAsymmetry   0.2      MieScaleHeight   8   }`

Added after 1 minute 15 seconds:
Mars
Using inverse Rayleigh parameters (more red light scattered than blue) for a brown sky and blue sunset.

Code: Select all

`   Atmosphere   {      Height      80      Mie      0.002      Rayleigh   [ 0.0017 0.00082 0.00044 ]      MieScaleHeight   11.1      CloudMap   "mars-clouds.*"      CloudHeight   30   }`

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
Looks pretty good as a set to work with. Off the bat I can suggest Mars is just dust with Mie Scattering and essentially no Rayleigh. It is reddish-brown dust though. At high phase angle it is more reddish-brown, though from the surface near the sun the sky is a bit bluish.

Good to see the Pluto ring effect looks distinctly bluish. This is related to the so-called "Angstrom Exponent". What this means is that smaller haze particles start to act like a "quasi-Rayleigh" effect since they are starting to approach the size of the molecules. In other words, Rayleigh scattering has a 4th power of scattering vs inverse wavelength (an Angstrom Exponent of 4). I forget the value for Pluto though it's probably in the neighborhood of 2.
Last edited by scalbers on 02.03.2017, 22:57, edited 1 time in total.
http://stevealbers.net

Topic author
FarGetaNik
Posts: 432
Joined: 05.06.2012
With us: 6 years 10 months
Location: Germany
scalbers wrote:Looks pretty good as a set to work with. Off the bat I can suggest Mars is just dust with Mie Scattering and essentially no Rayleigh. It is reddisih-brown dust though. At high phase angle it is more reddish-brown, though from the surface near the sun the sky is a bit bluish.

Oh good to know. I stumbled apon an atmosphere definition based on Rayleigh scattering, I used it for the sunset's sake. It makes sense Mars' atmosphere is mostly Mie scattering, I am thinking of images showing the Tharsis Montes poking through a haze layer. I am unsure how much is due lokal cloud haze. It won't be any trouble tinting the haze brownish with some absorption, but this won't recreate the blue sunset. This would be a different effect entirely. The inverse Rayleigh scattering is the only way to get close to with Celestia's capablities for now.

scalbers wrote:Good to see the Pluto ring effect looks distinctly bluish. This is related to the so-called "Angstrom Exponent". What this means is that smaller haze particles start to act like a "quasi-Rayleigh" effect since they are starting to approach the size of the molecules. In other words, Rayleigh scattering has a 4th power of scattering vs inverse wavelength (an Angstrom Exponent of 4). I forget the value for Pluto though it's probably in the neighborhood of 2.

I didnt hear of this phenomenon before. Also something to consider when modeling alien atmopheres. Maybe we could simulate this already using Rayleigh scattering with a different exponent, adjusted for Pluto? I haven't used Rayleigh on Pluto because it also is dominant at low phase angles, where we see almost no atmosphere in New Horizons images.

I worked on Titan again. I removed Mie scattering entirely and simulated the atmosphere with only Rayleigh scattering and an additional transparent cloud layer. I used a fairly high scale height.
Titan Rayleigh Atmosphere.zip

When viewing from low and medium phase angles, the apearance comes pretty close to Cassini images. The clouds of real Titan transmit some light, but in Celestia they block the scatted light entirely. Although when viewing Titan at high phase angles without clouds, I get a realistic view again. Peeking over to Space Engine shows that they fade away the cloud layer at high phase angles.

john71
Posts: 405
Joined: 10.08.2016
With us: 2 years 8 months
Whoa, guys, you are good.

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
Tharsis is so high up that it would extend above most of the dust given the 11km scale height.

Pluto is distinctive in that the aerosols have a high Angstrom exponent making them blue and high asymmetry parameter emphasizing forward scattering. It seems that luck would play a role in getting this to work by assuming Rayleigh scattering.

Generally the aerosols can be defined by things like asymmetry parameter (how much forward the scattering is), and single scattering albedo (how much scattering relative to extinction there is) for each color. From this a phase function can be calculated for each of the 3 colors and then various situations should be handled better. The angstrom exponent can influence things by having a different optical depth for each color. This might more or less be in the Celestia parameters already. Can these be defined or implemented more clearly somehow?

Looks good for Titan. I'm presently working to simulate a ground-based view. The optical thickness is around 5 for the aerosols, varying a lot with wavelength. Maybe at some point I can try both ground and space-based views.
http://stevealbers.net

Topic author
FarGetaNik
Posts: 432
Joined: 05.06.2012
With us: 6 years 10 months
Location: Germany
scalbers wrote:This might more or less be in the Celestia parameters already. Can these be defined or implemented more clearly somehow?

Oh my, I recall reading somewhere a short description of the atmosphere parameters somewhere, but I can't find it on the Celestia wikibooks anymore. I would really apprecciate a full explantion, since I can't seem to get these parameters right. And it's hard to know what effects are already implemented, we have a asymmetry parameter, but it seems Mie theory is much more complex and would need more parameters to work.

Maybe we should keep track on atmospheric effects missing in Celestia. Even with what we have implemented already, it seems there are some simplification/bugs that ruin some atmopheres. With my latest Titan atmosphere, without the clouds at low phase angles the Rayleigh scattering gives the atmophere a reddish brown color near the surface. Shouldn't there be also be backscattered blue light tinting this area more of a brighter grey? Also the scattering effect extends well into the night side, where almost no light should be emitting, right? Or is this due to absorption in reality?

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
I'm still learning about Titan, though I believe over the total column the Mie scattering by aerosols Is greater than the Rayleigh scattering by the gases. The color of the aerosols tints the disk of Titan orange with backscattering and I believe with forward scattering. Both the single scattering albedos and asymmetry factors come into play for this with the various wavelengths. Like Pluto the Angstrom exponent comes into play. My guess is the blue that shows up is when looking near the limb is due to the gases extending higher up compared with the aerosols. The atmosphere extends up high enough so twilight occurs over a large area into the hemisphere facing opposite the sun. If I find the reference I've been using about Titan's aerosols I'll go ahead and post it.

I wonder how extensive the clouds really are - I suspect most of what we see from a distance relates to the aerosols and gases.

Hopefully a combination of this thread and a Wiki or other documentation can help in suggesting software improvements.
http://stevealbers.net

Topic author
FarGetaNik
Posts: 432
Joined: 05.06.2012
With us: 6 years 10 months
Location: Germany
I agree there is also Mie scattering and possible more coplex effects at work with Titan's atmosphere. The upper blue layer in its atmosphere though can easily be regreated with Raykeigh scattering, and ignoring the clouds gives also nice results in forward scattered light. What bothres be is that twilight is always visible as a ring sourrinding Tian with my settings, but when comparing it to Cassini images, most of it is blocked by the planet itself, only at hight phase angles, when the scattered light from the opposite side of the planet is no longer blocked by Titan's mass, we start so see a ring of light. I'm talking about images like this one by Gordan Ugarkovic: https://www.flickr.com/photos/ugordan/377690817/in/album-72157594305164185/ compared to this: https://www.flickr.com/photos/ugordan/226008867/in/album-72157594305164185/

The cloud layer also is an important part. I think Huygens found the haze to clear at much lower altitudes than we think of Titan's cloud height, but I don't have the data to support this.

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
Yes, the haze of Titan would be higher up and I think patchy clouds at lower altitudes. They might be fairly sparse though depending on the season. Here is the reference for Titan I mentioned earlier: http://ciclops.org/media/sp/2010/6514_15623_0.pdf

Gordan's images are of two different brightness settings. With more brightness we can see more in the twilight area. I suppose there would be a certain range of phase angles where twilight should be visible as a ring. Perhaps we can describe further what this range of phase angles is, both for reality and for Celestia?

Does anyone know where in the Celestia source code the atmospheric scattering is done?
http://stevealbers.net

selden
Developer
Posts: 10051
Joined: 04.09.2002
With us: 16 years 7 months
Location: NY, USA
A grep looking for the string Mie in Celestia's source files discovers the calculations to be in celengine/shadermanager.cpp

Here are some partial results:

Code: Select all

`\$ grep Mie */*.cppcelengine/shadermanager.cpp:    // Evaluate the Mie and Rayleigh phase functions; both are functions of the cosinecelengine/shadermanager.cpp:    source += "    float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));\n";celengine/shadermanager.cpp:        source += "    " + VarScatterInVS() + " = (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * sunColor * " + scatter + ";\n";`
Selden

john71
Posts: 405
Joined: 10.08.2016
With us: 2 years 8 months
I hope I'm not off-topic... I'm working on my TRAPPIST-1 add-on and TRAPPIST-1g is a planet kind of hard to "create"...

How can I change the light scattering to a more "alien" setting? It is now like on Earth.

Last edited by john71 on 04.03.2017, 20:28, edited 1 time in total.

Topic author
FarGetaNik
Posts: 432
Joined: 05.06.2012
With us: 6 years 10 months
Location: Germany
I have to check out that article later.

scalbers wrote:With more brightness we can see more in the twilight area
Sure, but there is a range of phase angles where there is no circumplanetary (?) twilight even for great overexposure (second image I linked), which I can't recreate in Celestia.

scalbers wrote:Perhaps we can describe further what this range of phase angles is, both for reality and for Celestia?

It's simple for Celestia: As soon as there is a considerably amount of Rayleigh scatering, the range is 0-180°. Here 2 views of Titan, the right being at the same phase angle as the second image:

For real Titan, it will be quite complicated to find the right set of images with phase information to find this range, maybe there already exists a phase funktion for Titan? Because Titan's atmosphere is quite thick compared to it's radius, maybe we can get close by simple geometry (ignoring scattering) by finding the angle Titan's bulk doesn't block it's atmosphere anymore.

Added after 2 minutes 22 seconds:
john71 wrote:How can I change the light scattering to a more "alien" setting? It is now like on Earth.

Just play around with the atmosphere parameters. Often little changes result in crazy results... maybe some aborption (in this case maybe blue and a bit of green for the M-dwarf's sake) can give an alien color, or an unusual set of Rayleigh parameters.

john71
Posts: 405
Joined: 10.08.2016
With us: 2 years 8 months
Thanks!

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
I'll guess the Titan ring would show up at phase angles >150 degrees or so.

Thanks Selden for the software info as well.
http://stevealbers.net

Gakyun
Posts: 2
Joined: 07.03.2017
With us: 2 years 1 month
These really do look pretty, good work here.

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
I can note I see a Rayleigh scale height in the code here, the file is src/tools/atmosphere/scattertable.cpp:

atm.rayleighScaleHeight = params["RayleighScaleHeight"];

Can this be set or passed in via the scripts? I do see an 'earth.cfg' file in the same directory where these parameters are set. Can this be edited while running Celestia?
http://stevealbers.net

Topic author
FarGetaNik
Posts: 432
Joined: 05.06.2012
With us: 6 years 10 months
Location: Germany
Nice, we are getting close! Hm I don't see this directory in my Celestia installation, I've been looking for some config file for atmospheric light scattering, without success. It seems we cannot modify this parameter in a compiled application. I will try if I can simply use "RayleighScaleHeight" as a ssc command... that would be neat.

Added after 8 minutes 32 seconds:
...ok the parameter seems to have no effect whatsoever. So it can't be used in ssc files.

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
Thanks for checking, I think I had found someones test code on the GitHub for download. Is there an official link to the main source code? One overall aspect of the code is to figure out what happens in the shader routines and what happens in the .cpp (C++) code. They both have references to scattering. Perhaps the shaders are more generic and the C++ code is for some specific Earth and Titan applications?
Last edited by scalbers on 19.03.2017, 20:52, edited 1 time in total.
http://stevealbers.net

Topic author
FarGetaNik
Posts: 432
Joined: 05.06.2012
With us: 6 years 10 months
Location: Germany
Oh I'm not familiar with the source code of Celestia. But there are 2 ways of rendering an atmosphere: An "old" one used prior to Celestia 1.5 or 1.6, using color parameters for sky, dawn, low and high atmophere. In Celestia 1.6.1 only Earth and Titan are using the advanded scattering parameters (Mie and Rayleigh scattering). Maybe it's reffering to these 2 different ways?

scalbers
Posts: 138
Joined: 30.01.2005
With us: 14 years 2 months
That's good since we've been largely looking at Earth and Titan. When running Celestia with the associated executable download, I wonder if the 'earth.cfg' file can be found anywhere?

Also, maybe I'll try to look at this source branch here, though maybe Alexell can let us know which place to look for the most recent code?

https://github.com/CelestiaProject/Celestia

Here are the atmosphere source and config files I mentioned:

https://github.com/CelestiaProject/Celestia/tree/master/src/tools/atmosphere
Last edited by scalbers on 19.03.2017, 21:26, edited 2 times in total.
http://stevealbers.net