Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/release-content/migration-guides/generalized_atmosphere.md
7223 views
---
title: "Generalized Atmospheric Scattering Media" authors: ["@ecoskey"] pull_requests: [20838]
---

Most of the fields on Atmosphere have been removed in favor of a handle to the new ScatteringMedium asset.

pub struct Atmosphere { pub bottom_radius: f32, pub top_radius: f32, pub ground_albedo: Vec3, + pub medium: Handle<ScatteringMedium>, - pub rayleigh_density_exp_scale: f32, - pub rayleigh_scattering: Vec3, - pub mie_density_exp_scale: f32, - pub mie_scattering: f32, - pub mie_absorption: f32, - pub mie_asymmetry: f32, - pub ozone_layer_altitude: f32, - pub ozone_layer_width: f32, - pub ozone_absorption: Vec3, }

Unfortunately, this means Atmosphere no longer implements Default. Instead, you can still access the default earthlike atmosphere through the EarthlikeAtmosphere resource:

fn setup_camera( mut commands: Commands, earthlike_atmosphere: Res<EarthlikeAtmosphere> ) { commands.spawn(( Camera3d, earthlike_atmosphere.get(), )); }