Simplify the dictionary value extraction in the RenderableAtmosphere

This commit is contained in:
Alexander Bock
2021-01-03 11:57:00 +01:00
parent 3d74d6051e
commit 198160000d
5 changed files with 595 additions and 669 deletions
@@ -10,74 +10,66 @@ local Atmosphere = {
Parent = transforms.Earth.Identifier,
Renderable = {
Type = "RenderableAtmosphere",
Atmosphere = {
-- Atmosphere radius in Km
AtmosphereRadius = 6447.0,
PlanetRadius = 6377.0,
PlanetAverageGroundReflectance = 0.1,
GroundRadianceEmittion = 0.6,
SunIntensity = 6.9,
Rayleigh = {
-- Atmosphere radius in Km
AtmosphereRadius = 6447.0,
PlanetRadius = 6377.0,
PlanetAverageGroundReflectance = 0.1,
GroundRadianceEmittion = 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 = {
-- 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.
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 }
},
-- 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,
-- },
Image = {
ToneMapping = jToneMapping,
Exposure = 0.4,
Background = 1.8,
Gamma = 1.85
},
Debug = {
PreCalculatedTextureScale = 1.0,
SaveCalculatedTextures = false
}
-- 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
},
ShadowGroup = {
Source1 = {
@@ -8,53 +8,51 @@ local Atmosphere = {
Parent = transforms.Mars.Identifier,
Renderable = {
Type = "RenderableAtmosphere",
Atmosphere = {
-- Atmosphere radius in Km
AtmosphereRadius = 3463.17495,
--PlanetRadius = 3396.19,
--PlanetRadius = 3393.0,
PlanetRadius = 3386.190,
PlanetAverageGroundReflectance = 0.1,
GroundRadianceEmittion = 0.37,
SunIntensity = 13.1,
MieScatteringExtinctionPropCoefficient = 0.23862,
Rayleigh = {
Coefficients = {
-- Wavelengths are given in 10^-9m
Wavelengths = { 680, 550, 440 },
-- Reflection coefficients are given in km^-1
Scattering = { 19.918E-3, 13.57E-3, 5.75E-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 = 10.43979
-- Atmosphere radius in Km
AtmosphereRadius = 3463.17495,
--PlanetRadius = 3396.19,
--PlanetRadius = 3393.0,
PlanetRadius = 3386.190,
PlanetAverageGroundReflectance = 0.1,
GroundRadianceEmittion = 0.37,
SunIntensity = 13.1,
MieScatteringExtinctionPropCoefficient = 0.23862,
Rayleigh = {
Coefficients = {
-- Wavelengths are given in 10^-9m
Wavelengths = { 680, 550, 440 },
-- Reflection coefficients are given in km^-1
Scattering = { 19.918E-3, 13.57E-3, 5.75E-3 }
-- In Rayleigh scattering, the coefficients of
-- absorption and scattering are the same.
},
-- Default
Mie = {
Coefficients = {
-- Reflection coefficients are given in km^-1
Scattering = { 53.61771e-3, 53.61771e-3, 53.61771e-3 },
-- Extinction coefficients are a fraction of the Scattering coefficients
Extinction = { 53.61771e-3/0.98979, 53.61771e-3/0.98979, 53.61771e-3/0.98979 }
},
-- Mie Height scale (atmosphere thickness for constant density) in Km
H_M = 3.09526,
-- Mie Phase Function Value (G e [-1.0, 1.0].
-- If G = 1.0, Mie phase function = Rayleigh Phase Function)
G = 0.85
-- Thichkness of atmosphere if its density were uniform, in Km
H_R = 10.43979
},
-- Default
Mie = {
Coefficients = {
-- Reflection coefficients are given in km^-1
Scattering = { 53.61771e-3, 53.61771e-3, 53.61771e-3 },
-- Extinction coefficients are a fraction of the Scattering coefficients
Extinction = { 53.61771e-3/0.98979, 53.61771e-3/0.98979, 53.61771e-3/0.98979 }
},
Image = {
ToneMapping = jToneMapping,
Exposure = 0.4,
Background = 1.8,
Gamma = 1.85
},
Debug = {
-- PreCalculatedTextureScale is a float from 1.0 to N, with N > 0.0 and N in Naturals (i.e., 1, 2, 3, 4, 5....)
PreCalculatedTextureScale = 1.0,
SaveCalculatedTextures = false
}
-- Mie Height scale (atmosphere thickness for constant density) in Km
H_M = 3.09526,
-- Mie Phase Function Value (G e [-1.0, 1.0].
-- If G = 1.0, Mie phase function = Rayleigh Phase Function)
G = 0.85
},
Image = {
ToneMapping = jToneMapping,
Exposure = 0.4,
Background = 1.8,
Gamma = 1.85
},
Debug = {
-- PreCalculatedTextureScale is a float from 1.0 to N, with N > 0.0 and N in Naturals (i.e., 1, 2, 3, 4, 5....)
PreCalculatedTextureScale = 1.0,
SaveCalculatedTextures = false
}
},
GUI = {
@@ -8,51 +8,49 @@ local Atmosphere = {
Parent = transforms.Venus.Identifier,
Renderable = {
Type = "RenderableAtmosphere",
Atmosphere = {
-- Atmosphere radius in Km
AtmosphereRadius = 6121.9,
PlanetRadius = 6051.9,
PlanetAverageGroundReflectance = 0.018,
GroundRadianceEmittion = 0.8,
SunIntensity = 11.47,
--MieScatteringExtinctionPropCoefficient = 0.23862,
Rayleigh = {
Coefficients = {
-- Wavelengths are given in 10^-9m
Wavelengths = { 680, 550, 440 },
-- Reflection coefficients are given in km^-1
Scattering = { 19.518E-3, 13.83E-3, 3.65E-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 = 3.53
-- Atmosphere radius in Km
AtmosphereRadius = 6121.9,
PlanetRadius = 6051.9,
PlanetAverageGroundReflectance = 0.018,
GroundRadianceEmittion = 0.8,
SunIntensity = 11.47,
--MieScatteringExtinctionPropCoefficient = 0.23862,
Rayleigh = {
Coefficients = {
-- Wavelengths are given in 10^-9m
Wavelengths = { 680, 550, 440 },
-- Reflection coefficients are given in km^-1
Scattering = { 19.518E-3, 13.83E-3, 3.65E-3 }
-- In Rayleigh scattering, the coefficients of
-- absorption and scattering are the same.
},
-- Default
Mie = {
Coefficients = {
-- Reflection coefficients are given in km^-1
Scattering = { 53.61771e-3, 53.61771e-3, 53.61771e-3 },
-- Extinction coefficients are a fraction of the Scattering coefficients
Extinction = { 53.61771e-3/0.98979, 53.61771e-3/0.98979, 53.61771e-3/0.98979 }
},
-- Mie Height scale (atmosphere thickness for constant density) in Km
H_M = 5.42,
-- Mie Phase Function Value (G e [-1.0, 1.0].
-- If G = 1.0, Mie phase function = Rayleigh Phase Function)
G = 0.85
-- Thichkness of atmosphere if its density were uniform, in Km
H_R = 3.53
},
-- Default
Mie = {
Coefficients = {
-- Reflection coefficients are given in km^-1
Scattering = { 53.61771e-3, 53.61771e-3, 53.61771e-3 },
-- Extinction coefficients are a fraction of the Scattering coefficients
Extinction = { 53.61771e-3/0.98979, 53.61771e-3/0.98979, 53.61771e-3/0.98979 }
},
Image = {
ToneMapping = jToneMapping,
Exposure = 0.4,
Background = 1.8,
Gamma = 1.85
},
Debug = {
-- PreCalculatedTextureScale is a float from 1.0 to N, with N > 0.0 and N in Naturals (i.e., 1, 2, 3, 4, 5....)
PreCalculatedTextureScale = 1.0,
SaveCalculatedTextures = false
}
-- Mie Height scale (atmosphere thickness for constant density) in Km
H_M = 5.42,
-- Mie Phase Function Value (G e [-1.0, 1.0].
-- If G = 1.0, Mie phase function = Rayleigh Phase Function)
G = 0.85
},
Image = {
ToneMapping = jToneMapping,
Exposure = 0.4,
Background = 1.8,
Gamma = 1.85
},
Debug = {
-- PreCalculatedTextureScale is a float from 1.0 to N, with N > 0.0 and N in Naturals (i.e., 1, 2, 3, 4, 5....)
PreCalculatedTextureScale = 1.0,
SaveCalculatedTextures = false
}
},
GUI = {