[REQUEST] Add the Inverse-Square Law for sunlight

joffrey

Member
Joined
Mar 16, 2012
Messages
48
Reaction score
0
Points
6
Hi everyone !

If you are a SpaceEngine user, you probably know that there is a option called "Real Planet Brightness" that shows us how planets are less illuminated with the distance from the sun.

Below an example, that shows on the left how Jupiter appears without the option (the image is globally the same for NASA's pictures or Orbiter), and on the right how it appears with the option which reproduces that the human eye really see :

1400349108-5-jupiter.png


Now for Saturn and Neptune :

1400349099-6-saturne.png


1400349112-8-neptune.png


I think it could be good and educational to add this option in Orbiter, probably in visual options, to enable the inverse-square law for sunlight.

What's your opinion about this idea ?

(I don't know if it's the good way, but I created an "issue" in "ORBITER: 2010-P1 > Feature". http://www.orbiter-forum.com/project.php?issueid=1136)

Bye
 
Last edited:

Aeadar

Lurker Representitive
Donator
Joined
Apr 30, 2009
Messages
456
Reaction score
3
Points
18
I would like to see something like this as well. It's my understanding however, that it couldn't be accurately implemented due to...well, I'm not really sure. Something to do with the brightness range on monitors or some such.

Personally I don't really care if it's accurate or not, so long as there's some sort of diminishing illumination as one gets further from the sun.

I like the idea of a dim outer solar system.

:cheers:
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
It could be done in a graphics client easily enough, but then you have other issues. The problem is that you'll see pretty much nothing anymore further out. And then you'd have to implement local lightsources that actually look good on a planets surface, which isn't as simple as it sounds...
 

Artlav

Aperiodic traveller
Addon Developer
Beta Tester
Joined
Jan 7, 2008
Messages
5,790
Reaction score
780
Points
203
Location
Earth
Website
orbides.org
Preferred Pronouns
she/her
Simply speaking, the eye scale any actual brightness into the same bright-dark range.
So, indoors appear about as brightly lit as sunlight outside.
But, if look from outside indoors, you'll see pitch blackness (unless you have some serious light inside), and if you look from indoors outside, you'll see washed-out white.
Yet, the difference between the two is many orders of magnitude.

A computer monitor, however, have exactly 256 levels of brightness, so any attempt at realistic light level simulation is doomed to fail.

Might be made as an effect of some sort, but not anything realistic.
 

Glider

Addon Developer
Addon Developer
Joined
Apr 12, 2008
Messages
226
Reaction score
0
Points
16
Location
Saint-Petersburg
I don't see anything realistic in this - for any camera or eye the picture will be more or less same near Earth or Saturn because camera or eye will accommodate to the luminosity of objects that it can see. Actual brightness of a surface near Mercury and same surface near Saturn will differ about 650 times while monitors can show up to 256 levels of brightness. So near Mercury something will be white and near Saturn it will be black.

The only way to implement it realisticaly is HDR rendering (which Space Engine uses) because it works with real brightness values before the post-processing stage and having real values of brightness near Mercury and Saturn will actually be noticable by the brightness or engine exhaust, stars and local light sources (which have constant brightness). But none of graphics clients of Orbiter support HDR.
 

fsci123

Future Dubstar and Rocketkid
Addon Developer
Joined
Aug 18, 2010
Messages
1,536
Reaction score
0
Points
0
Location
?
I say the least we could do is add some sort of relative brightness thing to orbiter. Or maybe include a luminosity value in star configs.

Personally I would like my red dwarf system to be dim and red not bright and sunny.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
Personally I would like my red dwarf system to be dim and red not bright and sunny.

There you have your unrealism, then. The light around a red dwarf would appear about as red to our eyes as the sun's light appears yellow (i.e., not at all). Red dwarfs are called red because they emit most of their energy in the infrared. The magnitude of the visible light would still be enough to appear pretty white to our eyes.
 

donatelo200

Aerospace Engineer
Addon Developer
Joined
Sep 23, 2009
Messages
482
Reaction score
28
Points
43
Location
Cincinnati
Actually red dwarfs would have a dull orange hue similar to an old incandescent light bulb. However looking at them directly would still not be ideal for your eyes. :)
 

Marg

Active member
Joined
Mar 20, 2008
Messages
484
Reaction score
68
Points
28
Wrong idea, yeah, because human eyes can adapt to wide range of illumination.
 

Linguofreak

Well-known member
Joined
May 10, 2008
Messages
5,034
Reaction score
1,273
Points
188
Location
Dallas, TX
Actually red dwarfs would have a dull orange hue similar to an old incandescent light bulb.

Which, as Jedidia said, is perceived pretty much as white. We have incandescent lighting currently running in my house right now, and you only really notice that it's not white if you think about it.
 

fsci123

Future Dubstar and Rocketkid
Addon Developer
Joined
Aug 18, 2010
Messages
1,536
Reaction score
0
Points
0
Location
?
Kinda came up with an equation that simulates inverse square but stays within the limits 0-255 screen brightness. I'm gonna keep working on equations hopefully I can simulate the light effects on some software I have and hopefully it can be implemented in orbiter.


y=1/((1/256)+(e)^(4x))

Second revision:
y=(1/((1/256)+(e/0.5)^x))+(1/(0.5+(e)^(-x)))
Third version: got rid of the notch at the end...i have yet to attempt to simulate eye adjustment...
y=(1/((1/256)+(e/0.5)^x))+(1/(1+(e/0.5)^(-x)))
 
Last edited:

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
Nitpick: use 1/255 instead of 1/256 -- max brightness is 255 not 256. Attempting to use 256 will actually give you 1 due to integer overflow. Also, use exp(x) instead of e^x -- it's faster.

...And what is the range of x anyway?
 

fsci123

Future Dubstar and Rocketkid
Addon Developer
Joined
Aug 18, 2010
Messages
1,536
Reaction score
0
Points
0
Location
?
Fourth revision accounting for eye adjustment(hopefully)

y-64=1/((1/128)+(e/0.5)^x)

Fifth revision:

y-64=1/((1/128)+(e/0.5)^(-x⋅10-4))
 
Last edited:

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
This won't work very well.

For one, I'm not sure how you got the idea for adjusted brightness and how you did the math on it, but the e^x will be a mess and 1 divided by a mess is a mess.

Remember that x at Uranus and Neptune is already large. You have floating point issues there. e^x is then an insane value. Even more floating point errors.

e^(-x), even if it's a very low x, will quickly fall off to be almost 0.

1 divided by a value close to 0 is prone to numerical errors as it's again a very large value. Just values very close to 0 are prone to numerical errors.

Then you have the expression 1/128 + lots and lots that's like saying 1 000 000 000 + 0.0078. The 0.0078 stops mattering.

A little bit of trivia: (e / 0.5) = 2e

Also, what you ended up creating is essentially an exponential function. At long distances (long in this case is more than 10 meters from the center of the Sun), the function looks like e^(-x), which drops off FASTER than 1/r^2, so you haven't adjusted for the darkness, you made it worse.
 
Top