diff --git a/crates/bevy_pbr/src/atmosphere/mod.rs b/crates/bevy_pbr/src/atmosphere/mod.rs index 4b6065c76dc7b..ddfc731444a37 100644 --- a/crates/bevy_pbr/src/atmosphere/mod.rs +++ b/crates/bevy_pbr/src/atmosphere/mod.rs @@ -266,7 +266,14 @@ pub struct Atmosphere { /// light it absorbs per meter. /// /// units: m^-1 - pub ozone_absorption: Vec3, + pub ozone_absorption: Vec3, + + /// Multiplier to control the visibility of the sun disc. + /// Set to 1.0 to show the sun disc (default) or 0.0 to hide it. + pub sun_disc_mult: f32, + + + } impl Atmosphere { @@ -280,9 +287,10 @@ impl Atmosphere { mie_scattering: 3.996e-6, mie_absorption: 0.444e-6, mie_asymmetry: 0.8, - ozone_layer_altitude: 25_000.0, + ozone_layer_altitude: 25_000.0, ozone_layer_width: 30_000.0, ozone_absorption: Vec3::new(0.650e-6, 1.881e-6, 0.085e-6), + sun_disc_mult: 1.0, }; pub fn with_density_multiplier(mut self, mult: f32) -> Self { @@ -376,8 +384,11 @@ pub struct AtmosphereSettings { /// A conversion factor between scene units and meters, used to /// ensure correctness at different length scales. pub scene_units_to_m: f32, + + } + impl Default for AtmosphereSettings { fn default() -> Self { Self { diff --git a/crates/bevy_pbr/src/atmosphere/types.wgsl b/crates/bevy_pbr/src/atmosphere/types.wgsl index 78e9e9a717192..93b54c74508ea 100644 --- a/crates/bevy_pbr/src/atmosphere/types.wgsl +++ b/crates/bevy_pbr/src/atmosphere/types.wgsl @@ -20,6 +20,9 @@ struct Atmosphere { ozone_layer_altitude: f32, // units: m ozone_layer_width: f32, // units: m ozone_absorption: vec3, // ozone absorption. units: m^-1 + // Multiplier to control the visibility of the sun disc. + // Set to 1.0 to show the sun disc (default) or 0.0 to hide it. + sun_disc_mult: f32, } struct AtmosphereSettings {