ADCS.helpers.animations.godot.assets.atmosphere module¶
Precomputed atmosphere tables for the viewer, after Hillaire (2020), “A Scalable and Production Ready Sky and Atmosphere Rendering Technique” (CGF 39(4); reference code: github.com/sebh/UnrealEngineSkyAtmosphere, MIT).
Two small tables are computed here; the viewer ray-marches the atmosphere per pixel with them (the method’s path for views from space):
transmittance
T(r, mu)from a point at radiusralong a ray with zenith cosinemuto the top of the atmosphere, using the texture parameterisation of Bruneton (2017), so it stays accurate near the horizon;multiple scattering
Psi(r, mu_s): radiance from all orders >= 2 per unit scattering coefficient, for unit solar irradiance (Hillaire’s infinite-order approximation, isotropic phase, ground albedo bounce).
Lengths are metres. The atmosphere sits on Earth’s equatorial radius so it matches the rendered globe. Rayleigh, Mie and ozone coefficients follow Bruneton and Hillaire; scale heights are slightly broadened for a more visible orbital limb.
- class ADCS.helpers.animations.godot.assets.atmosphere.AtmosphereParams(bottom_radius: float = 6378137.0, top_radius: float = 6418137.0, rayleigh_scattering: Tuple[float, float, float] = (5.802e-06, 1.3558e-05, 3.31e-05), rayleigh_scale_height: float = 10500.0, mie_scattering: Tuple[float, float, float] = (3.996e-06, 3.996e-06, 3.996e-06), mie_extinction: Tuple[float, float, float] = (4.44e-06, 4.44e-06, 4.44e-06), mie_scale_height: float = 1450.0, mie_g: float = 0.8, ozone_absorption: Tuple[float, float, float] = (6.5e-07, 1.881e-06, 8.5e-08), ozone_center: float = 25000.0, ozone_half_width: float = 15000.0, ground_albedo: float = 0.3, transmittance_size: Tuple[int, int] = (256, 64), multiscattering_size: Tuple[int, int] = (32, 32))[source]¶
Bases:
object- Parameters:
bottom_radius (float)
top_radius (float)
rayleigh_scattering (Tuple[float, float, float])
rayleigh_scale_height (float)
mie_scattering (Tuple[float, float, float])
mie_extinction (Tuple[float, float, float])
mie_scale_height (float)
mie_g (float)
ozone_absorption (Tuple[float, float, float])
ozone_center (float)
ozone_half_width (float)
ground_albedo (float)
transmittance_size (Tuple[int, int])
multiscattering_size (Tuple[int, int])
- bottom_radius: float = 6378137.0¶
- ground_albedo: float = 0.3¶
- mie_extinction: Tuple[float, float, float] = (4.44e-06, 4.44e-06, 4.44e-06)¶
- mie_g: float = 0.8¶
- mie_scale_height: float = 1450.0¶
- mie_scattering: Tuple[float, float, float] = (3.996e-06, 3.996e-06, 3.996e-06)¶
- multiscattering_size: Tuple[int, int] = (32, 32)¶
- ozone_absorption: Tuple[float, float, float] = (6.5e-07, 1.881e-06, 8.5e-08)¶
- ozone_center: float = 25000.0¶
- ozone_half_width: float = 15000.0¶
- rayleigh_scale_height: float = 10500.0¶
- rayleigh_scattering: Tuple[float, float, float] = (5.802e-06, 1.3558e-05, 3.31e-05)¶
- top_radius: float = 6418137.0¶
- transmittance_size: Tuple[int, int] = (256, 64)¶
- ADCS.helpers.animations.godot.assets.atmosphere.build_tables(p=AtmosphereParams(bottom_radius=6378137.0, top_radius=6418137.0, rayleigh_scattering=(5.802e-06, 1.3558e-05, 3.31e-05), rayleigh_scale_height=10500.0, mie_scattering=(3.996e-06, 3.996e-06, 3.996e-06), mie_extinction=(4.44e-06, 4.44e-06, 4.44e-06), mie_scale_height=1450.0, mie_g=0.8, ozone_absorption=(6.5e-07, 1.881e-06, 8.5e-08), ozone_center=25000.0, ozone_half_width=15000.0, ground_albedo=0.3, transmittance_size=(256, 64), multiscattering_size=(32, 32)))[source]¶
- Parameters:
p (AtmosphereParams)
- Return type:
Dict[str, ndarray]
- ADCS.helpers.animations.godot.assets.atmosphere.multiscattering_table(p, transmittance, directions=64, steps=40)[source]¶
(H, W, 3)float32 table of Psi_ms; rows are altitude (bottom to top), columns mu_s in [-1, 1] (Hillaire 2020, section 5.5).For every texel, rays are marched in
directionsuniformly spread directions;L2is second-order radiance from single-scattered sunlight (isotropic phase) plus the ground bounce,f_msthe scattered fraction of a unit isotropic illumination. Psi = L2 / (1 - f_ms) sums all orders.- Parameters:
p (AtmosphereParams)
transmittance (ndarray)
directions (int)
steps (int)
- Return type:
ndarray
- ADCS.helpers.animations.godot.assets.atmosphere.transmittance_table(p, steps=500)[source]¶
(H, W, 3)float32 table; rows are r (bottom to top), columns mu.- Parameters:
p (AtmosphereParams)
steps (int)
- Return type:
ndarray
- ADCS.helpers.animations.godot.assets.atmosphere.transmittance_uv(p, r, mu)[source]¶
Texture coordinates of (r, mu) in the transmittance table (Bruneton 2017).
- Parameters:
p (AtmosphereParams)
r (ndarray)
mu (ndarray)
- Return type:
Tuple[ndarray, ndarray]