Page 1 of 4

Whole Earth View

Posted: 26.02.2017, 19:52
by scalbers
I've been doing a good deal of Earth rendering in recent times and I'd like to suggest a few tweaks for Celestia if visual realism is desired. This includes a bit less specular reflection intensity over the ocean and a bit more atmosphere Rayleigh scattering. More info is here:

http://stevealbers.net/albers/allsky/outerspace.html (top image pair)

http://stevealbers.net/albers/allsky/tpsblog.html

Posted: 26.02.2017, 20:16
by john71
Why don't you write the code for this function of Celestia? Maybe you should ask Alexell...or work with a programmer...

Posted: 26.02.2017, 20:23
by scalbers
It's possible the code may already be in Celestia and one could start with a simple adjustment of some parameters. If needed, then code changes can be considered to try and emulate what my ray-tracing package is doing. I'd be happy to work with Alexell and others on this.

Posted: 26.02.2017, 20:26
by john71
I think you should contact him...We need a moderator here...help! :help:

Posted: 26.02.2017, 20:39
by FarGetaNik
I was never happy how the atmospheric scattering in Celestia works, it is really unpredictable and still has some rendering bugs. But it's quite beautiful and based on real phenomena...

Seeing these screenshots Earth's atmosphere seems a bit too hazy when compared to DISCOVR images, but it's always difficult to find reference images close to human vision. If you increase the Rayleigh scattering parameter for Earth, I just get a rainbow-colored marble. Mie scattering seems to do the trick, a value of 0.01 get close to what we see, but then you start to see annoying artifacts of this effect in Celestia.

Posted: 26.02.2017, 20:44
by scalbers
I've discussed the reasons for the differences from the DSCOVR website images in my second web link. It turns out that a simple adjustment of contrast of each color of the DSCOVR images can make them (in my opinion) better gamma corrected and thus match pretty closely my renderings. More Rayleigh scattering should increase the blue more when looking at the center of the Earth, and near the limb it should get more greenish or grayish. Consider that looking down at the ocean, it's the same sky that we look up to from the ground. It's the air and not the ocean that contributes most of the light (unless one is in the sun-glint area). Mie scattering should help too, especially for a crescent Earth view.

You might get a "second opinion" here by checking out some ISS videos. Even through they are from low Earth orbit, they tend to show the atmosphere more prominently. It can be considered a numbers game in the sense of the reflectances involved with the Rayleigh scattering, Ocean surface, and land surface. The gamma correction (not always done in various website images) tends to reduce the contrast and make things look hazier.

Posted: 26.02.2017, 21:15
by FarGetaNik
scalbers wrote:It turns out that a simple adjustment of contrast of each color of the DSCOVR images can make them (in my opinion) better gamma corrected and thus match pretty closely my renderings.

That is certainly true and I wasn't sure myself how these images were calibrated. When searching for Earth images I get very inconsitent results, most are renders, but a few are real photographs. Apollo and DISCOVR images tend to show a good amount of contrast, but I've seen some Rosetta images that are quite close to your linked screenshots. I guess your argumentation is correct, but it's just very difficult for me to value the realism of Earth images. It's a shame.

scalbers wrote:More Rayleigh scattering should increase the blue more when looking at the center of the Earth, and near the limb it should get more greenish or grayish.

That might be true in theory, but it's not what I get in Celestia the way it handles scattering (hence unpredictable). The limb shows a color gradient from green to orange when increasing Rayleigh scattering by a noticable amount :eh: And when increasing Mie scattering the brightness of the atmosphere saturates to white and at high phase angles completely blocks the vision to the ground texture.

Posted: 26.02.2017, 21:45
by scalbers
Yes FarGetaNik it's a balance between everything. It may be true that at high phase angles there is enough Mie scattering to make the land much less visible, depending on the particular aerosol content.

Thanks for the tip about Rosetta, here is a nice image processed by Gordan Ugarkovich:

https://www.flickr.com/photos/ugordan/7372919352

I just posted a low phase angle (high sun) launch animation for consideration here:

http://stevealbers.net/albers/allsky/outerspace.html#highsun

I should actually recheck my clouds to ensure they are bright enough. The contrast between clouds and clear sky is an important part of the realism. As per john71's advice I sent a PM to Alexell about this thread.

Posted: 27.02.2017, 12:38
by FarGetaNik
Yes but I never saw any image at high phase angles with haze blocking the view. As you said, it depends on balance.

Another image showing a hazy Earth is this one: https://www.flickr.com/photos/ugordan/5672792247/
Again, it depends on the camera and processing how hazy or crisp it looks.

Hopefully these effects can be implemented in Celestia. Also It'll be nice to render the effects of Rayleigh scattering on the ground texture, this would give your renders a nice warm hue, also in the Rosetta picture you linked the specular reflection is clearly tinted yellow because of a high scattering angle.

The best I can do right now is this:
Edit: Setting the MieAsymmetry to 0 (unlike default of -0.25) gives a more realistic result:
Earth-scattering2.jpg


The textures are from Blue Marble Next Generation.

Here the ssc code I'm using for Earth:

Code: Select all

SpecularColor   [ 0.72 0.64 0.52 ]
SpecularPower   75

Atmosphere
{
   Mie      0.01
   MieAsymmetry   0
   Rayleigh   [ 0.001 0.0025 0.006 ]
   MieScaleHeight   12
}

Posted: 27.02.2017, 19:58
by scalbers
Thanks for the efforts and continuing food for thought. The high phase angles are usually associated with a crescent Earth. With these images it seems that clouds will dominate the view so it's a challenge to get a clear look at the land. Land is most visible in sun-glint areas it seems and relatively invisible in other areas. There is a possible mechanism for me to underestimate the land in this case, if light reflects off of the ground and then the haze. It would be interesting to see how significant this is, possibly if the crescent isn't too thin.

The addition of Rayleigh scattering when looking at the nadir should give a cooler overall hue compared with a no atmosphere case. The blue light is added from the atmosphere and essentially is superimposed upon what we see from the land. On the other hand, the relative contribution of the land is warmer when looking near the limb, due to the Rayleigh scattering preferentially attenuating the blue light coming off the land.

Nice LROC image by Gordan. I will try a render of Gordan's crescent Rosetta view to see if I can reproduce the orange glint. Here the blue light of the glint is preferentially scattered away by Rayleigh scattering at the high zenith angles leaving orange to show up in the view.

I'll see if I can set up a Celestia run to use your nicely improved version as a starting point. What I'd further suggest is dimming the land albedo a little bit, along with lowering the specular power for the sun glint. Interesting that the land on the crescent view, though still visible, is lowered in contrast. Based on a paper I can reference, it's useful to convert the image counts in the RGB Blue Marble imagery to the albedo values to give a more accurate rendering of the land surface relative to the other image elements. Is there any implied calibration of textures to albedo? If there was, and if the Rayleigh scattering can be specified by the optical depth at some wavelength, then we'd have a more absolute way of specifying things in Celestia.

Posted: 01.03.2017, 09:58
by FarGetaNik
There are just so many effects to consider, Celestia doesn't render all of them right now, so it's hard to get a good approximation. After a bit of research I found the scale height of Earth's atmosphere to be 8.5 km rather than 12 km, assuming this applies to Mie scattering. In my screenshot Earth looks almost a bit brownish, which is what happens when using a high amount of Mie scattering, I don't know if this effect also occurs in reality.

scalbers wrote:What I'd further suggest is dimming the land albedo a little bit, along with lowering the specular power for the sun glint.

The specular power and specular brightness also are difficult to reproduce. Celestia fades out this effect at high phase angles, whereas in reality the intensity seems to increase. For albedo, are there any reference values for ocean, glaciers, forest, desert etc.? It is really hard to estimate the correct brightness for the texture. I assumed BMNG is calibrated already.

scalbers wrote:Is there any implied calibration of textures to albedo?

Because of the non-linear brightness-funktion (gamma) I assume that the brightness of a pixel is the squareroot of its albedo. This is giving me nice results so far when calibrating textures. Please correct me if I got something wrong.

Added after 3 minutes 49 seconds:
Now because of this discussion I am redoing all the atmospheres for the solar system. If anyone is interested, I might start a new topic to show my results.

Posted: 01.03.2017, 20:05
by scalbers
I agree Earth's atmosphere scale height is 8.5 km, though this applies just to the Rayleigh scattering. It is usually less for aerosols (Mie scattering) at around 2km, though sometimes up to around 5km. Rayleigh scattering can be specified at sea level using about 0.14 optical depth for green light (546nm). This has a known single scattering phase function also.

Indeed specular reflection should be less at low phase angle (much less than Celestia presently has) and more at higher phase angle. There are reference values of albedos of various land surface types, though I'm getting better results using the BMNG with the calibration that is shown below.

As kind of a side point my images are slightly bluer than might be standard since I set my sRGB white point to be the same as the color temperature of the Sun (about 5800K). Correspondingly I set my computer monitor to this same color temperature, instead of the often used 6500K.

A square root function is a good approximation of a gamma correction upon image display that usually should be about 2.2. It seems Celestia would then assume that the Blue Marble (BMNG) data has pixel count values that are proportional to the albedo and that 255 counts is an albedo of 1.0? There is actually a spline being used and I am approximating this using a simple piecewise polynomial. This will yield different results than assumptions of a linear or square-root function in the texture.

! result(I,j) is the count value for the particular color channel
if(result(i,j) .le. 179.)then ! Based on NASA spline
albedo(ic,i,j) = .0010 * result(i,j) + 6.92e-11 * result(i,j)**4.0
elseif(result(i,j) .le. 255.)then
albedo(ic,i,j) = 0.25 + (result(i,j) - 179.) / 122.
endif

Would be interesting to consider the other planets' atmospheres as well.

Posted: 02.03.2017, 11:04
by FarGetaNik
scalbers wrote:I agree Earth's atmosphere scale height is 8.5 km, though this applies just to the Rayleigh scattering. It is usually less for aerosols (Mie scattering) at around 2km, though sometimes up to around 5km. Rayleigh scattering can be specified at sea level using about 0.14 optical depth for green light (546nm). This has a known single scattering phase function also.

Oh thanks for clarification. So much to consider for a realistic Earth view. Hm but Rayleigh scattering also occurs at particles right? Is it a different type of particle then?

scalbers wrote:As kind of a side point my images are slightly bluer than might be standard since I set my sRGB white point to be the same as the color temperature of the Sun (about 5800K). Correspondingly I set my computer monitor to this same color temperature, instead of the often used 6500K.

So this is why yours look more blue. This calibration sounds reasonable. My display isn't calibrated that well. But for a better comparision, the reference images should be calibrated similarly. Also Celestia tints all solar system objects yellowish, so it's hard to get it right.

scalbers wrote:A square root function is a good approximation of a gamma correction upon image display that usually should be about 2.2. It seems Celestia would then assume that the Blue Marble (BMNG) data has pixel count values that are proportional to the albedo and that 255 counts is an albedo of 1.0? There is actually a spline being used and I am approximating this using a simple piecewise polynomial. This will yield different results than assumptions of a linear or square-root function in the texture.

Using a gamma value of 2.2 should improve the results indeed, considering this value is used more often. But Celestia doesn't assume anything, it just uses the albedo value and pixel brightness you put in. So you are calibrating the texture when rendering it? I didn't change anything about BMNG, I just assumed it was calibrated already and my result looks good enough. But for lets say Ceres, having a bond albedo of 0.036 it makes a huge difference, my texture peaks at a value of around 20%.

Posted: 02.03.2017, 12:44
by selden
Celestia tints all solar system objects yellowish

That coloration of star(sun)light is one of Celestia's significant defects, I think.

(One could compensate for it by changing the Sun's SpectralType appropriately.)

Visually, the "yellow" peak in the light from G type stars is so broad that their light actually is white to our eyes. This is even the case for most "red" stars. Stellar color designations are primarily ways to classify them, not visual descriptions, except for very extreme situations. The slight yellow tint that we see when looking at the Sun in the sky is due to the scattering of blue wavelengths away from it in the Earth's atmosphere. It is not because the Sun's light is intrinsically a shade of yellow.

Posted: 02.03.2017, 13:27
by FarGetaNik
selden wrote:Visually, the "yellow" peak in the light from G type stars is so broad that their light actually is white to our eyes. This is even the case for most "red" stars.

I heard that the human eye would adapt to the color temperature of foreign stars to some extend. I won't mind if Celestia colored planets according to star temperature, but the color balance of Celestia's spectral types is just off. G-types seem to be too yellowish and M-types have a pink tint, instead of a wam beige. Using a simple black-body model would do the trick I think.

Posted: 02.03.2017, 19:45
by scalbers
Indeed the human eye can adapt somewhat. Still I agree with the above that the sun is essentially white when seen from space and looks yellow only due to the atmosphere. My second link in post #1 mentions the 3-step procedure that includes a black-body solar spectrum model for determining the RGB colors.

With scattering it is the main gases (e.g. N2 and O2) that do the Rayleigh scattering and the aerosols (dust or haze particles) that do the Mie scattering. Clouds also are Mie scatterers, though they more often have multiple scattering.

For the BMNG albedo, I do a pre-calibration to save an albedo data file, and this could be done in a texture image if we specify the pixel count to albedo relationship. In addition to the polynomial I mentioned above, a color correction was recently added to compensate for the differences in wavelength between the MODIS filters and the peaks of the CIE color matching functions that I use to assign red, green, and blue wavelengths. This correction noticeably is helpful in reducing the redness of Sahara and Arabian peninsula. It is actually reddish only in smaller patches and the overall color is more yellow.

So these are the main considerations. There are some possible refinements with vegetation, since the green reflectance of chlorophyll is a relatively narrow spectral peak. Thus I may be displaying green vegetation a bit too strong. Albedo is directionally averaged reflectance. Thus the actual reflectance of various land surface types would have a bit of dependence on the geometry. Generally the land is a bit darker in the forward scattering direction and brighter with back scattering. Hopefully all these things can be approximated or adjusted reasonably in Celestia.

Posted: 02.03.2017, 22:13
by FarGetaNik
scalbers wrote:With scattering it is the main gases (e.g. N2 and O2) that do the Rayleigh scattering and the aerosols (dust or haze particles) that do the Mie scattering. Clouds also are Mie scatterers, though they more often have multiple scattering.

I see, I have to do more research on atmoshperic scattering. Sitting back and doing some thinking, it makes sense differenct scattering sources display different scale heights. To bad Celestia can't do it yet.

I'd like to see what a calibrated albedo texture of Earth would look like in comparision to BMNG raw data. These calibrations seem essential, not only for Eath, but all textures around the solar system. I spend so much time getting them look realistic.

scalbers wrote:hus the actual reflectance of various land surface types would have a bit of dependence on the geometry. Generally the land is a bit darker in the forward scattering direction and brighter with back scattering.

Yet another phenomenon Celestia isn't really capable of. I don't recall how this is called, but it's already implemented in Space Engine. Also I like to modify the brightness/phase relation with the command "LunarLambert", but this is overwritten by specularity, so it can't be used when ocean reflectance is desired. This gives a really unnatural appearance of Earth when toggling atmosphere.

Posted: 02.03.2017, 23:16
by scalbers
Yes it would be nice to generate some calibrated textures. At some point I can try one for the Earth for testing, if I can convert my albedo data file back into an image. It could then be scaled so 0 counts is 0% albedo, 255 counts is 100% albedo, with a linear scale in between if that would work? Thus 128 counts would be about 50% albedo. Or should the albedo image be gamma corrected with an approximate square root function?

Posted: 03.03.2017, 00:12
by FarGetaNik
scalbers wrote:It could then be scaled so 0 counts is 0% albedo, 255 counts is 100% albedo, with a linear scale in between if that would work? Thus 128 counts would be about 50% albedo.

Actually, I would prefer a gamma-function instead of a linear scale, so 127 counts be around 25% albedo (depending on the gamma parameter). But I could work with a texture of linear brightness and simply adjust gamma afterwards.

Please correct me if I hve the wrong idea, but this gave me nice results so far. Here a comparison of Ceres vs. Earth and Moon. The relative brightness seems ok to me...

Albedo-comparison.jpg

Posted: 03.03.2017, 01:09
by scalbers
Sounds good, I'll consider doing the gamma corrected Earth texture.

Looks very nice for the moon, similar to DSCOVR lunar transit images. For some random commenting, I believe the albedo of the moon varies from about 4% to 18% though a full moon gets a brightness boost of up to a factor of 1.4 from the opposition effect. The Earth's land surface albedo is I think usually in the range of 0.05 to 0.3 with coniferous forests being darkest and deserts brightest (excluding snow/ice). Water outside of the sun glint is pretty low, something like 1-2% reflectance and mostly blue. The ratio between reflectance and albedo is sometimes called the ARF or anisotropic reflectance factor, once again depending on the geometry.