Planetshine

Discussion forum for Celestia developers; topics may only be started by members of the developers group, but anyone can post replies.
Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Planetshine

Post #21by chris » 01.04.2008, 22:53

Cross-posted from the developers list

Here's a rather large patch against the current SVN version of Celestia that implements secondary illumination:

http://www.celestiaproject.net/~claurel/celest ... hine.patch

Problems have been reported with the patch file; you may want to use this zip archive with all the changed files instead:

http://www.celestiaproject.net/~claurel/celest ... tshine.zip

For testing purposes only, planetshine can be toggled on and off with Ctrl+X (antialias lines.) This toggle will be removed before the code is committed to SVN.

The patch includes a significant cleanup and streamlining of
Celestia's lighting code; it simply wasn't practical to implement
secondary illumination /without/ this cleanup. The performance
benefits from this cleanup should more than compensate for the extra
computation required for secondary lighting.

I've worked hard to make Celestia's implementation of secondary
illumination both fast and general. Secondary illumination can come
from objects that aren't in the same 'system'. Thus the Cassini
spacecraft can be lit by light reflected from Earth, Venus, Jupiter,
Saturn, or any of Saturn's moons even though its orbit is defined
relative to the Sun. This is different how eclipse shadows work:
they're currently only computed for objects in the same system, and so
Cassini will never be eclipsed by Saturn (at least, not until a
subsequent patch addresses the limitation.)

Both reflector phase and reflector-to-receiver distance are accounted
for in the calculation of secondary illumination. There are two ways
in which distance affects the amount of light reaching the receiver:
obviously, the received energy falls off with 1/distance^2. But, the
distance also affects what part of the reflecting object is visible to
the receiver. An object in low Earth orbit like ISS sees only a small
fraction of the Earth's surface at one time, thus using something like
a simple (1+cos(phase))/2 correction to the amount of reflected light
will produce noticeably wrong lighting. The code in the patch uses a
more sophisticated approach that is still an approximation but gives
correct looking results in all cases.

Some limitations:
- All reflecting objects are treated as spheres
- Spacecraft, components, and surface features don't reflect light;
this was done in order to avoid terrible slowdowns with add-ons like
Selden's Hale telescope that have complex assemblies of small models.
And with a mass of irregular objects, the lighting wouldn't be correct
anyway.
- Only the brightest secondary illuminator is considered. This is easy
to fix, but at the expense of performance. It's probably not
worthwhile until HDR support lets us see the effects of very faint
light sources.
- You'll note that Earthshine isn't visible on the Moon; there's an
adjustable 'gamma' setting that would make it visible. Right now, it's
set so that secondary illumination will be visible when it is at least
10^-4 times as bright as the primary illumination. Earthshine on the
Moon is just barely under the cutoff. This gamma value can be
modified, but at the expense of underemphasizing light intensity
differences between more similar light sources. My feeling is that we
should wait for HDR rendering to be more developed before playing with
this value too much.

The best places to see planetshine are spacecraft in low orbits or
doing low-altitude fly-bys. The Martian satellites and inner moons of
the giant planets also show off the effect nicely.

One other thing that this patch addresses is orbit visibility for
barycenters. People often complain that the orbit of Pluto is no
longer visible now that it's defined as relative to the Pluto-Charon
barycenter rather than the Sun. In the process of implementing
secondary lighting, I had to introduce an 'object type' mask for frame
tree nodes. The mask contains the types of all objects that are
children of the node. With a small change to the orbit code, the mask
is used to render the orbit of a barycenter when planets or moons
orbit it.

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Planetshine

Post #22by cartrite » 02.04.2008, 09:31

I've built the planetshine with and without hdr enabled. I've been testing the ISS model and do notice a nice shine on the dark side of the model when it is over the day side of earth. It is also interesting to see the change over when the model is at the point where it is about to go to the darkside of the earth and is still in view of the setting sun.
But with hdr enabled, there is hardly any shine at all. When I toggle "ctrl-x", I can see a slight difference to show that it is working. But it is hard to tell the difference.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 2 months
Location: Massachusetts, USA

Re: Planetshine

Post #23by buggs_moran » 02.04.2008, 17:31

Chris wrote:Spacecraft, components, and surface features don't reflect light;
this was done in order to avoid terrible slowdowns with add-ons like
Selden's Hale telescope that have complex assemblies of small models.
And with a mass of irregular objects, the lighting wouldn't be correct
anyway.

I know this would probably be a hassle, but why not have the ability to switch
reflective like emmisive, and like emmisive, have the default be false?
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Planetshine

Post #24by chris » 02.04.2008, 18:10

buggs_moran wrote:
Chris wrote:Spacecraft, components, and surface features don't reflect light;
this was done in order to avoid terrible slowdowns with add-ons like
Selden's Hale telescope that have complex assemblies of small models.
And with a mass of irregular objects, the lighting wouldn't be correct
anyway.

I know this would probably be a hassle, but why not have the ability to switch
reflective like emmisive, and like emmisive, have the default be false?

It's not that much of a hassle: anticipating that people might want to override the default, the reflectivity is controlled by a flag on the object. That flag is set automatically based on the object's class when it is read from an ssc file. It would be easy to add a boolean property for ssc objects. Is there any particular reason why want this?

--Chris

buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 2 months
Location: Massachusetts, USA

Re: Planetshine

Post #25by buggs_moran » 02.04.2008, 18:30

I know it's not exactly a reflection per se, but the effect might be neat on glass or metal objects
like the stations solar panels.

Also, Selden could, if he wished, just have the dome and outer building be reflective, not all the parts.
However, would planetshine effect a surface object, unless we are talking increased albedo above
snow covered areas...

Reflectivity on and emmisive off may give interesting effects as well.
Homebrew:

WinXP Pro SP2

Asus A7N8X-E Deluxe

AMD Athlon XP 3000/333 2.16 GHz

1 GB Crucial RAM

80 GB WD SATA drive

ATI AIW 9600XT 128M

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Planetshine

Post #26by chris » 03.04.2008, 17:16

The planetshine changes have now been checked into SVN (revision 4237).

--Chris

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

Re: Planetshine

Post #27by ElChristou » 03.04.2008, 19:34

chris wrote:The planetshine changes have now been checked into SVN (revision 4237).

Just tested and it's just... E x c e l l e n t !

Even Voyager which is quite dark get some smooth lighting during the approach of planets... The shuttle also become much more realistic... If one day we implement shadows, Celestia will be really sublime...

Bravo Chris!
Image

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: Planetshine

Post #28by Cham » 03.04.2008, 20:05

I already found a bug !

The planet shine doesn't work if Celestia's antialiasing is OFF. I'm getting the planet illumination only if I check ON the antialiasing in the preferences. This is bad, since I'm already using FSAA from my video card.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Planetshine

Post #29by chris » 03.04.2008, 20:06

Cham wrote:I already found a bug !

The planet shine doesn't work if Celestia's antialiasing is OFF. I'm getting the planet illumination only if I check ON the antialiasing in the preferences. This is bad, since I'm already using FSAA from my video card.

Sorry--this was some debugging code that should not have made it into SVN. Ctrl+x toggled planetshine on and off to make it easy to compare what could sometimes be a very subtle lighting effect.

--Chris

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Re: Planetshine

Post #30by fsgregs » 04.04.2008, 01:57

Chris or anyone:

Is there any Windows compiled version of this planetshine upgrade to Celestia 1.5.0 available yet? I've accessed CVS and found only the January/08 release of Celestia 1.5.0 final for Windows on it. Am I looking in the wrong place??

Frank

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Planetshine

Post #31by chris » 04.04.2008, 02:44

fsgregs wrote:Chris or anyone:

Is there any Windows compiled version of this planetshine upgrade to Celestia 1.5.0 available yet? I've accessed CVS and found only the January/08 release of Celestia 1.5.0 final for Windows on it. Am I looking in the wrong place??

Frank

Celestia is using SVN (Subversion) instead of CVS for source control. But, if you're looking for a compiled version of Celestia, that's probably not what you want anyway. Both cartrite and phoenix regularly build the Windows version of Celestia from SVN and make the files available for download:

http://cartrite.myhosting247.com/index.html
http://www.purebytes.de/stuff/celestia/

It doesn't look like either build has been updated with the planetshine change, but I'm sure it won't be long. I can make a build for you tomorrow if cartrite or phoenix don't beat me to it.

--Chris

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Re: Planetshine

Post #32by steffens » 04.04.2008, 06:54

chris wrote:Sorry--this was some debugging code that should not have made it into SVN. Ctrl+x toggled planetshine on and off to make it easy to compare what could sometimes be a very subtle lighting effect.
Will planetshine be enabled by default, a rendering option or a keyboard toggle?

These screenshots look spectacular! Looking forward to the weekend, I hope I will have some time to play with this!

steffens

volcanopele
Posts: 103
Joined: 05.02.2007
With us: 17 years 9 months

Re: Planetshine

Post #33by volcanopele » 04.04.2008, 08:10

chris wrote:It doesn't look like either build has been updated with the planetshine change, but I'm sure it won't be long. I can make a build for you tomorrow if cartrite or phoenix don't beat me to it.
Sounds great, Chris! Now I want to see if NH can catch some Charon-shine on Pluto.
Hands off: C55AFB738D58F4B81D3A4722551D25E1
The Gish Bar Times - A Blog all about Jupiter's Moon Io

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Planetshine

Post #34by cartrite » 04.04.2008, 10:08

My website now contains svn r4239 which should include the planetshine feature.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Re: Planetshine

Post #35by fsgregs » 04.04.2008, 13:08

Thanks for posting the Windows exe files. I just cannot believe it! Celestia just keeps getting better and better. Planetshine is spectacular.

Pretty soon, there will be Astronauts waving from the windows of the Shuttle :D

Here are screenshots of the 2001 space station viewed from two different angles. Unbelievably realistic!!!! WOW!
SS1.jpg
SS2.jpg

CAP-Team
Posts: 194
Joined: 27.12.2006
Age: 49
With us: 17 years 11 months
Location: Vriezenveen, the Netherlands
Contact:

Re: Planetshine

Post #36by CAP-Team » 04.04.2008, 18:16

Hmm well I've downloaded Cartrite's version, but planetshine doesn't seem to work.
I always have Ambient ligt set to none, but the Enceladus scene Chris posted is not like the picture he posted, the dark side of Enceladus is still black.
Windows 7 Ultimate x64, Intel Core i7 2600K 3.4 Ghz, 4 GB RAM, 120 GB SSD + 1 TB hdd, nVidia GTX460 1 GB, Celestia 1.6.0.xxxx
Download my latest SVN Build

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Planetshine

Post #37by chris » 04.04.2008, 18:21

CAP-Team wrote:Hmm well I've downloaded Cartrite's version, but planetshine doesn't seem to work.
I always have Ambient ligt set to none, but the Enceladus scene Chris posted is not like the picture he posted, the dark side of Enceladus is still black.

It works fine for me, though the planetshine on Enceladus is rather subtle. Try looking at a moon closer to Saturn or at a spacecraft in low Earth orbit such as Hubble.

--Chris

CAP-Team
Posts: 194
Joined: 27.12.2006
Age: 49
With us: 17 years 11 months
Location: Vriezenveen, the Netherlands
Contact:

Re: Planetshine

Post #38by CAP-Team » 04.04.2008, 21:51

Funny, it's working now :) (I tried mimas, and then Enceladus), and Hubble works now, too.

I do have noticed that there's a weird behaviour of an addon that works fine in 1.5.0 but with every new SVN version gives a weird effect:

saturn.jpg


The addon uses a cloud map, which isn't rendered correctly.
Windows 7 Ultimate x64, Intel Core i7 2600K 3.4 Ghz, 4 GB RAM, 120 GB SSD + 1 TB hdd, nVidia GTX460 1 GB, Celestia 1.6.0.xxxx
Download my latest SVN Build

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: Planetshine

Post #39by Cham » 04.04.2008, 22:47

CAP-Team wrote:Funny, it's working now :) (I tried mimas, and then Enceladus), and Hubble works now, too.

I do have noticed that there's a weird behaviour of an addon that works fine in 1.5.0 but with every new SVN version gives a weird effect:

saturn.jpg


The addon uses a cloud map, which isn't rendered correctly.

I believe this is the result of cloud shadows on gas giants. I already talked to Chris about this before. The cloud shadows shouldn't be turned ON in the case of gas giants.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

CAP-Team
Posts: 194
Joined: 27.12.2006
Age: 49
With us: 17 years 11 months
Location: Vriezenveen, the Netherlands
Contact:

Re: Planetshine

Post #40by CAP-Team » 05.04.2008, 09:25

I've tested this, turning cloud shadows off while viewing Saturn corrects the image; the weird clouds are gone.
Windows 7 Ultimate x64, Intel Core i7 2600K 3.4 Ghz, 4 GB RAM, 120 GB SSD + 1 TB hdd, nVidia GTX460 1 GB, Celestia 1.6.0.xxxx
Download my latest SVN Build


Return to “Ideas & News”