Merged branch Atmosphere.

This commit is contained in:
Jonathas Costa
2016-06-09 11:45:56 -04:00
46 changed files with 4779 additions and 86 deletions
+89
View File
@@ -0,0 +1,89 @@
function preInitialization()
--[[
The scripts in this function are executed after the scene is loaded but before the
scene elements have been initialized, thus they should be used to set the time at
which the scene should start and other settings that might determine initialization
critical objects.
]]--
--YYYY-MM-DDTHH:MN:SS
--openspace.time.setTime(openspace.time.currentWallTime())
--[[
-- March 9, 2016 total eclipse times from land
-- Palembang, South Sumatra, Indonesia
-- Partial solar eclipse begins: 6:20 a.m. local Western Indonesian Time
-- Total solar eclipse begins: 7:20 a.m. local time
-- Maximum eclipse: 7:21 a.m. local time
-- Total solar eclipse ends: 7:22 a.m. local time
-- Partial solar eclipse ends: 8:31 a.m. local time
-- 6:20 -> 23:20 day before in UTC
]]--
openspace.time.setTime("2016-03-08T22:45:00")
-- Total Lunar Eclipse Jan 31, 2018 at 10:51:13 UTC
-- Regions seeing, at least, some parts of the eclipse: North/East Europe,
-- Asia, Australia, North/East Africa, North America, North/East South America,
-- Pacific, Atlantic, Indian Ocean, Arctic, Antarctica.
--openspace.time.setTime("2018-01-31T10:30:00")
--openspace.time.setDeltaTime(200.0)
dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua'))
end
function postInitialization()
--[[
The scripts in this function are executed after all objects in the scene have been
created and initialized, but before the first render call. This is the place to set
graphical settings for the renderables.
]]--
openspace.printInfo("Setting default values")
openspace.setPropertyValue("Sun.renderable.enabled", false)
openspace.setPropertyValue("SunMarker.renderable.enabled", false)
openspace.setPropertyValue("EarthMarker.renderable.enabled", false)
--openspace.setPropertyValue("Constellation Bounds.renderable.enabled", false)
openspace.setPropertyValue("PlutoTrail.renderable.enabled", false)
openspace.setPropertyValue("PlutoTexture.renderable.enabled", false)
openspace.setPropertyValue("MilkyWay.renderable.transparency", 0.55)
openspace.setPropertyValue("MilkyWay.renderable.segments", 50)
openspace.printInfo("Done setting default values")
end
return {
ScenePath = ".",
CommonFolder = "common",
Camera = {
Focus = "Earth",
--Focus = "Moon",
Position = {1, 0, 0, 5},
},
Modules = {
"sun",
"mercury",
"venus",
"earth",
"moon",
"mars",
--"jupiter",
"saturn",
"uranus",
"neptune",
"stars",
-- "stars-denver",
"milkyway",
-- "milkyway-eso",
--"constellationbounds",
-- "fieldlines",
--"io",
--"europa",
--"ganymede",
--"callisto",
--"gridGalactic",
--"gridEcliptic",
--"gridEquatorial",
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
return {
FileRequest = {
{ Identifier = "earth_textures", Destination = "textures", Version = 1 }
{ Identifier = "earth_textures", Destination = "textures", Version = 2 }
},
}
}
+79 -30
View File
@@ -4,21 +4,15 @@ return {
Name = "EarthBarycenter",
Parent = "SolarSystemBarycenter",
Static = true,
--[[
Ephemeris = {
Type = "Kepler",
Inclination = 0.00041,
AscendingNode = 349.2,
Perihelion = 102.8517,
SemiMajorAxis = 1.00002,
DailyMotion = 0.9855796,
Eccentricity = 0.0166967,
MeanLongitude = 328.40353
}
--]]
Ephemeris = {
Type = "Static"
}
Type = "Spice",
Body = "EARTH BARYCENTER",
Reference = "ECLIPJ2000",
Observer = "SUN",
Kernels = {
"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
}
},
},
-- Earth module
{
@@ -27,33 +21,88 @@ return {
Renderable = {
Type = "RenderablePlanet",
Frame = "IAU_EARTH",
Body = "EARTH",
Body = "EARTH",
Geometry = {
Type = "SimpleSphere",
Radius = { 6.371, 6 },
Segments = 100
},
Shadow_Group = {
Source1 = {
Name = "Sun",
-- All radius in meters
Radius = {696.3, 6}
},
--Source2 = { Name = "Monolith", Radius = {0.01, 6} },
Caster1 = {
Name = "Moon",
-- All radius in meters
Radius = {1.737, 6}
},
--Caster2 = { Name = "Independency Day Ship", Radius = {0.0, 0.0} }
},
Textures = {
Type = "simple",
Color = "textures/earth_bluemarble.jpg",
Night = "textures/earth_night.jpg",
Height = "textures/earth_bluemarble_height.jpg"
Night = "textures/earth_night.jpg",
--Height = "textures/earth_bluemarble_height.jpg",
-- Depth = "textures/earth_depth.png",
Reflectance = "textures/earth_reflectance.png",
Clouds = "textures/earth_clouds.jpg"
},
Atmosphere = {
Type = "Nishita", -- for example, values missing etc etc
MieFactor = 1.0,
MieColor = {1.0, 1.0, 1.0}
}
},
Ephemeris = {
Type = "Spice",
Body = "EARTH",
Reference = "ECLIPJ2000",
Observer = "SUN",
Kernels = {
"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
-- Atmosphere radius in Km
AtmoshereRadius = 6420,
--AtmoshereRadius = 6390,
--PlanetRadius = 6371,
PlanetRadius = 6360,
PlanetAverageGroundReflectance = 0.1,
Rayleigh = {
Coefficients = {
-- Wavelengths are given in 10^-9m
Wavelengths = {680, 550, 440},
-- Reflection coefficients are given in km^-1
Scattering = {5.8e-3, 1.35e-2, 3.31e-2},
-- In Rayleigh scattering, the coefficients of absorption and scattering are the same.
},
-- Thichkness of atmosphere if its density were uniform, in Km
H_R = 8.0,
},
-- Default
Mie = {
Coefficients = {
-- Reflection coefficients are given in km^-1
Scattering = {4e-3, 4e-3, 4e-3},
--Scattering = {2e-5, 2e-5, 2e-5},
-- Extinction coefficients are a fraction of the Scattering coefficients
Extinction = {4e-3/0.9, 4e-3/0.9, 4e-3/0.9}
-- Height scale (atmosphere thickness for constant density) in Km
},
H_M = 1.2,
-- Mie Phase Function Value (G e [-1.0, 1.0]. If G = 1.0, Mie phase function = Rayleigh Phase Function)
G = 1.0,
},
-- Clear Sky
-- Mie = {
-- Coefficients = {
-- Scattering = {20e-3, 20e-3, 20e-3},
-- Extinction = 1.0/0.9,
-- }
-- H_M = 1.2,
-- G = 0.76,
-- },
-- Cloudy
-- Mie = {
-- Coefficients = {
-- Scattering = {3e-3, 3e-3, 3e-3},
-- Extinction = 1.0/0.9,
-- }
-- H_M = 3.0,
-- G = 0.65,
-- },
}
},
GuiName = "/Solar/Planets/Earth"
},
-- EarthTrail module
@@ -82,7 +131,7 @@ return {
Billboard = true,
Texture = "textures/marker.png"
},
Ephemeris = {
Ephemeris = {
Type = "Static",
Position = {0, 0, 0, 5}
}
-5
View File
@@ -25,11 +25,6 @@ return {
Type = "simple",
Color = "textures/mars.jpg",
},
Atmosphere = {
Type = "Nishita", -- for example, values missing etc etc
MieFactor = 1.0,
MieColor = {1.0, 1.0, 1.0}
}
},
Ephemeris = {
Type = "Spice",
-5
View File
@@ -25,11 +25,6 @@ return {
Type = "simple",
Color = "textures/mercury.jpg",
},
Atmosphere = {
Type = "Nishita", -- for example, values missing etc etc
MieFactor = 1.0,
MieColor = {1.0, 1.0, 1.0}
}
},
Ephemeris = {
Type = "Spice",
+5
View File
@@ -0,0 +1,5 @@
return {
FileRequest = {
{ Identifier = "moon_textures", Destination = "textures", Version = 1 }
},
}
+68
View File
@@ -0,0 +1,68 @@
return {
-- Moon module
{
Name = "Moon",
Parent = "EarthBarycenter",
Renderable = {
Type = "RenderablePlanet",
Frame = "IAU_MOON",
Body = "MOON",
Geometry = {
Type = "SimpleSphere",
Radius = { 1.737, 6},
Segments = 100
},
Shadow_Group = {
Source1 = {
Name = "Sun",
Radius = {696.3, 6}
},
Caster1 = {
Name = "Earth",
Radius = {6.371, 6}
},
},
Textures = {
Type = "simple",
Color = "textures/Moon16K.dds",
--Color = "textures/moonmap4k.jpg",
},
},
Ephemeris = {
Type = "Spice",
Body = "MOON",
Reference = "ECLIPJ2000",
Observer = "EARTH BARYCENTER",
Kernels = {
"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
}
},
Rotation = {
Type = "Spice",
Frame = "IAU_MOON",
Reference = "ECLIPJ2000"
},
GuiName = "/Solar/Planets/MOON"
},
-- MoonTrail module
{
Name = "MoonTrail",
Parent = "EarthBarycenter",
Renderable = {
Type = "RenderableTrail",
Body = "MOON",
Frame = "GALACTIC",
Observer = "EARTH BARYCENTER",
RGB = { 0.5, 0.3, 0.3 },
TropicalOrbitPeriod = 60,
EarthOrbitRatio = 0.01,
DayLength = 1.0,
Textures = {
Type = "simple",
Color = "${COMMON_MODULE}/textures/glare_blue.png",
-- need to add different texture
},
},
GuiName = "/Solar/MoonTrail"
}
}
-5
View File
@@ -25,11 +25,6 @@ return {
Type = "simple",
Color = "textures/neptune.jpg",
},
Atmosphere = {
Type = "Nishita", -- for example, values missing etc etc
MieFactor = 1.0,
MieColor = {1.0, 1.0, 1.0}
}
},
Ephemeris = {
Type = "Spice",
-5
View File
@@ -25,11 +25,6 @@ return {
Type = "simple",
Color = "textures/saturn.jpg",
},
Atmosphere = {
Type = "Nishita", -- for example, values missing etc etc
MieFactor = 1.0,
MieColor = {1.0, 1.0, 1.0}
}
},
Ephemeris = {
Type = "Spice",
-5
View File
@@ -25,11 +25,6 @@ return {
Type = "simple",
Color = "textures/uranus.jpg",
},
Atmosphere = {
Type = "Nishita", -- for example, values missing etc etc
MieFactor = 1.0,
MieColor = {1.0, 1.0, 1.0}
}
},
Ephemeris = {
Type = "Spice",
-5
View File
@@ -25,11 +25,6 @@ return {
Type = "simple",
Color = "textures/venus.jpg",
},
Atmosphere = {
Type = "Nishita", -- for example, values missing etc etc
MieFactor = 1.0,
MieColor = {1.0, 1.0, 1.0}
}
},
Ephemeris = {
Type = "Spice",