Improved atmopheric light scattering

Discussion forum for Celestia developers; topics may only be started by members of the developers group, but anyone can post replies.
Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Improved atmopheric light scattering

Post #1by FarGetaNik » 13.10.2019, 18:16

While working on my improved atmopheric parameters for Earth I was made aware on the discord that back in the day, chris developed a tool called "scattersim" and posted a compiled version on the Celestial Matters forum. Using the Wayback Machine you can still download the executable. It's a commandline based programm that reads config files, for example provided on github.

A quck run using the titan2 config file:

Code: Select all

Radius                   2575

SurfaceRed               0.75
SurfaceGreen             0.75
SurfaceBlue              0.75

RayleighScaleHeight      79.0
RayleighRed              0.00106
RayleighGreen            0.0018
RayleighBlue             0.00323

MieScaleHeight           60.0
Mie                      0.0001
MieAsymmetry             0.25

AbsorbScaleHeight        79.0
AbsorbRed                0.0018
AbsorbGreen              0.011
AbsorbBlue               0.03



Gives a stunning result:

out.png


Would it be possible to implement atmopheric scattering using the code of this scatter simulator, if it's still saved on github? The current atmospheric modeling is really messy and produces several visible artifacts that are hard to overlook.

Looking at the data, you can clearly see that the scale heights for the different effects (Rayleigh, Mie and Absorption) differ vastly. Would it at the very least be possible to allow for these scale height parameters to be individually defined? Thinking back at a dicussion with steve albers I remember there is code avaliable in Celestia that already defines RayleighScaleHeight but for some reason this parameter is not used.

onetwothree
Site Admin
Posts: 706
Joined: 22.09.2018
With us: 6 years 2 months

Post #2by onetwothree » 14.10.2019, 12:15

There are several tutorials on the internet how to implement atmospheric scattering, but i haven't checked them against neither glsl nor scattersim code yet. Actually scattersim may not work now :)

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #3by FarGetaNik » 14.10.2019, 13:04

Oh well. How so?
While trying to apply some of the parameters to what Celestia does atm, it became very obvious that Celestia completely cuts of atmophereric rendering at idk... 2 scale heights or soemthing? For a start increasing (or removing?) this limit would help improve rendering already.

onetwothree
Site Admin
Posts: 706
Joined: 22.09.2018
With us: 6 years 2 months

Post #4by onetwothree » 14.10.2019, 14:48

FarGetaNik wrote:Oh well. How so?

It uses old inhome vector library replaced with Eigen, and as the rest of Celestia uses Eigen, we simply unable to build it. I have a branch with scattersim updated to Eigen, but I never had a reference implementation to check its output, afair it returns a black filled file. Now with the files you have found I'll try to fix port scatersim to Eigen properly.

FarGetaNik wrote:idk

What?

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #5by FarGetaNik » 14.10.2019, 20:56

onetwothree wrote:It uses old inhome vector library replaced with Eigen, and as the rest of Celestia uses Eigen, we simply unable to build it. I have a branch with scattersim updated to Eigen, but I never had a reference implementation to check its output, afair it returns a black filled file. Now with the files you have found I'll try to fix port scatersim to Eigen properly.

I see, that's a hope at least.

idk = I don't know. I was trying to say that I estimate the cutoff is at around 2 scale heights (I didn't bother measuring) but it's vey apparent that this cutoff is too low for realistic renders. No matter what you do, you will always be left with this hard border.


Return to “Ideas & News”