mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 20:21:24 -06:00
Apply simplification of shadow sources and casters to RenderableGlobe
This commit is contained in:
@@ -6,99 +6,98 @@ local assetHelper = asset.require('util/asset_helper')
|
||||
-- local earthEllipsoid = { 6378137.0, 6378137.0, 6356752.314245 }
|
||||
local earthEllipsoid = { 6378137.0, 6378137.0, 6378137.0 }
|
||||
local Atmosphere = {
|
||||
Identifier = "EarthAtmosphere",
|
||||
Parent = transforms.Earth.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableAtmosphere",
|
||||
-- Atmosphere radius in Km
|
||||
AtmosphereHeight = 6447.0 - 6377.0,
|
||||
PlanetRadius = 6377.0,
|
||||
PlanetAverageGroundReflectance = 0.1,
|
||||
GroundRadianceEmission = 0.6,
|
||||
SunIntensity = 6.9,
|
||||
Rayleigh = {
|
||||
Coefficients = {
|
||||
-- Wavelengths are given in 10^-9m
|
||||
Wavelengths = { 680, 550, 440 },
|
||||
-- Reflection coefficients are given in km^-1
|
||||
Scattering = { 5.8E-3, 13.5E-3, 33.1E-3 },
|
||||
-- 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
|
||||
},
|
||||
--[[
|
||||
Ozone = {
|
||||
Coefficients = {
|
||||
-- Extinction coefficients
|
||||
Extinction = {3.426, 8.298, 0.356}
|
||||
},
|
||||
H_O = 8.0,
|
||||
},
|
||||
]]
|
||||
-- Default
|
||||
Mie = {
|
||||
Coefficients = {
|
||||
-- Reflection coefficients are given in km^-1
|
||||
Scattering = { 4.0e-3, 4.0e-3, 4.0e-3 },
|
||||
-- Extinction coefficients are a fraction of the Mie coefficients
|
||||
Extinction = { 4.0e-3/0.9, 4.0e-3/0.9, 4.0e-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 = 0.85
|
||||
},
|
||||
-- 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,
|
||||
-- },
|
||||
Debug = {
|
||||
PreCalculatedTextureScale = 1.0,
|
||||
SaveCalculatedTextures = false
|
||||
Identifier = "EarthAtmosphere",
|
||||
Parent = transforms.Earth.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableAtmosphere",
|
||||
-- Atmosphere radius in Km
|
||||
AtmosphereHeight = 6447.0 - 6377.0,
|
||||
PlanetRadius = 6377.0,
|
||||
PlanetAverageGroundReflectance = 0.1,
|
||||
GroundRadianceEmission = 0.6,
|
||||
SunIntensity = 6.9,
|
||||
Rayleigh = {
|
||||
Coefficients = {
|
||||
-- Wavelengths are given in 10^-9m
|
||||
Wavelengths = { 680, 550, 440 },
|
||||
-- Reflection coefficients are given in km^-1
|
||||
Scattering = { 5.8E-3, 13.5E-3, 33.1E-3 },
|
||||
-- In Rayleigh scattering, the coefficients of absorption and scattering are the same.
|
||||
},
|
||||
ShadowGroup = {
|
||||
Sources = {
|
||||
{ Name = "Sun", Radius = 696.3E6 },
|
||||
-- { Name = "Monolith", Radius = 0.01E6 }
|
||||
-- Thichkness of atmosphere if its density were uniform, in Km
|
||||
H_R = 8.0
|
||||
},
|
||||
--[[
|
||||
Ozone = {
|
||||
Coefficients = {
|
||||
-- Extinction coefficients
|
||||
Extinction = {3.426, 8.298, 0.356}
|
||||
},
|
||||
H_O = 8.0,
|
||||
},
|
||||
]]
|
||||
-- Default
|
||||
Mie = {
|
||||
Coefficients = {
|
||||
-- Reflection coefficients are given in km^-1
|
||||
Scattering = { 4.0e-3, 4.0e-3, 4.0e-3 },
|
||||
-- Extinction coefficients are a fraction of the Mie coefficients
|
||||
Extinction = { 4.0e-3/0.9, 4.0e-3/0.9, 4.0e-3/0.9 }
|
||||
},
|
||||
Casters = {
|
||||
{ Name = "Moon", Radius = 1.737E6 },
|
||||
-- { Name = "Independence Day Ship", Radius = 0.0 }
|
||||
|
||||
}
|
||||
}
|
||||
-- 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 = 0.85
|
||||
},
|
||||
-- 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,
|
||||
-- },
|
||||
Debug = {
|
||||
PreCalculatedTextureScale = 1.0,
|
||||
SaveCalculatedTextures = false
|
||||
},
|
||||
GUI = {
|
||||
Name = "Earth Atmosphere",
|
||||
Path = "/Solar System/Planets/Earth",
|
||||
Description = [[ Atmosphere of Earth.]]
|
||||
ShadowGroup = {
|
||||
Sources = {
|
||||
{ Name = "Sun", Radius = 696.3E6 },
|
||||
-- { Name = "Monolith", Radius = 0.01E6 }
|
||||
},
|
||||
Casters = {
|
||||
{ Name = "Moon", Radius = 1.737E6 },
|
||||
-- { Name = "Independence Day Ship", Radius = 0.0 }
|
||||
}
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "Earth Atmosphere",
|
||||
Path = "/Solar System/Planets/Earth",
|
||||
Description = [[ Atmosphere of Earth.]]
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { Atmosphere })
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Earth Atmosphere",
|
||||
Version = "1.0",
|
||||
Description = [[ RenderableAtmosphere for Earth.]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"EarthAtmosphere"}
|
||||
Name = "Earth Atmosphere",
|
||||
Version = "1.0",
|
||||
Description = [[ RenderableAtmosphere for Earth.]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = { "EarthAtmosphere" }
|
||||
}
|
||||
|
||||
@@ -15,15 +15,11 @@ local Earth = {
|
||||
PerformShading = false,
|
||||
Layers = {},
|
||||
ShadowGroup = {
|
||||
Source1 = {
|
||||
Name = "Sun",
|
||||
-- All radius in meters
|
||||
Radius = 696.3E6
|
||||
Sources = {
|
||||
{ Name = "Sun", Radius = 696.3E6 },
|
||||
},
|
||||
Caster1 = {
|
||||
Name = "Moon",
|
||||
-- All radius in meters
|
||||
Radius = 1.737E6
|
||||
Casters = {
|
||||
{ Name = "Moon", Radius = 1.737E6 },
|
||||
}
|
||||
},
|
||||
Labels = {
|
||||
|
||||
@@ -26,15 +26,13 @@ local Moon = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
ShadowGroup = {
|
||||
Source1 = {
|
||||
Name = sunAsset.Sun.Name,
|
||||
Radius = 696.3E6
|
||||
Sources = {
|
||||
{ Name = sunAsset.Sun.Identifier, Radius = 696.3E6 },
|
||||
},
|
||||
Caster1 = {
|
||||
Name = earthAsset.Earth.Name,
|
||||
Radius = 6.371E6
|
||||
Casters = {
|
||||
{ Name = earthAsset.Earth.Identifier, Radius = 6.371E6 },
|
||||
}
|
||||
},
|
||||
},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
FileName = labelsPath .. "/moon.labels",
|
||||
|
||||
@@ -19,31 +19,15 @@ local Jupiter = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
ShadowGroup = {
|
||||
Source1 = {
|
||||
Name = "Sun",
|
||||
-- All radius in meters
|
||||
Radius = 696.3E6
|
||||
},
|
||||
Caster1 = {
|
||||
Name = "Ganymede",
|
||||
-- All radius in meters
|
||||
Radius = 2631000
|
||||
},
|
||||
Caster2 = {
|
||||
Name = "Io",
|
||||
-- All radius in meters
|
||||
Radius = 1821600
|
||||
},
|
||||
Caster3 = {
|
||||
Name = "Europa",
|
||||
-- All radius in meters
|
||||
Radius = 1560800
|
||||
},
|
||||
Caster4 = {
|
||||
Name = "Callisto",
|
||||
-- All radius in meters
|
||||
Radius = 2410000
|
||||
Sources = {
|
||||
{ Name = "Sun", Radius = 696.3E6 },
|
||||
},
|
||||
Casters = {
|
||||
{ Name = "Ganymede", Radius = 2631000 },
|
||||
{ Name = "Io", Radius = 1821600 },
|
||||
{ Name = "Europa", Radius = 1560800 },
|
||||
{ Name = "Callisto", Radius = 2410000 }
|
||||
}
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_giants" },
|
||||
|
||||
Reference in New Issue
Block a user