Skip to content

Commit 14518e9

Browse files
committed
cleanup
1 parent 5c6b9db commit 14518e9

File tree

6 files changed

+10
-23
lines changed

6 files changed

+10
-23
lines changed

crates/bevy_pbr/src/atmosphere/environment.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ use bevy_render::{
2929
use bevy_utils::default;
3030
use tracing::warn;
3131

32-
use super::Atmosphere;
33-
3432
// Render world representation of an environment map light for the atmosphere
3533
#[derive(Component, ExtractComponent, Clone)]
3634
pub struct AtmosphereEnvironmentMap {

crates/bevy_pbr/src/atmosphere/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ use bevy_asset::{embedded_asset, AssetId, Assets, Handle};
4242
use bevy_camera::Camera3d;
4343
use bevy_core_pipeline::core_3d::graph::Node3d;
4444
use bevy_ecs::{
45-
archetype::Archetype,
46-
component::{Component, Components},
47-
entity::Entity,
45+
component::Component,
4846
query::{Changed, QueryItem, With},
4947
resource::Resource,
5048
schedule::IntoScheduleConfigs,
@@ -77,7 +75,7 @@ use resources::{
7775
prepare_atmosphere_transforms, queue_render_sky_pipelines, AtmosphereTransforms,
7876
RenderSkyBindGroupLayouts,
7977
};
80-
use tracing::{debug, warn};
78+
use tracing::warn;
8179

8280
use crate::{
8381
resources::{prepare_atmosphere_uniforms, GpuAtmosphere},

crates/bevy_pbr/src/atmosphere/node.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use bevy_render::{
88
renderer::RenderContext,
99
view::{ViewTarget, ViewUniformOffset},
1010
};
11-
use tracing::warn;
1211

1312
use crate::{resources::GpuAtmosphere, ViewLightsUniformOffset};
1413

@@ -17,7 +16,7 @@ use super::{
1716
AtmosphereBindGroups, AtmosphereLutPipelines, AtmosphereTransformsOffset,
1817
RenderSkyPipelineId,
1918
},
20-
Atmosphere, GpuAtmosphereSettings,
19+
GpuAtmosphereSettings,
2120
};
2221

2322
#[derive(PartialEq, Eq, Debug, Copy, Clone, Hash, RenderLabel)]

crates/bevy_pbr/src/atmosphere/resources.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,8 @@ pub struct GpuAtmosphere {
532532
pub fn prepare_atmosphere_uniforms(
533533
mut commands: Commands,
534534
atmospheres: Query<(Entity, &ExtractedAtmosphere)>,
535-
gpu_media: Res<RenderAssets<GpuScatteringMedium>>,
536535
) -> Result<(), BevyError> {
537536
for (entity, atmosphere) in atmospheres {
538-
let gpu_medium = gpu_media
539-
.get(atmosphere.medium)
540-
.ok_or(ScatteringMediumMissingError(atmosphere.medium))?;
541537
commands.entity(entity).insert(GpuAtmosphere {
542538
ground_albedo: atmosphere.ground_albedo,
543539
bottom_radius: atmosphere.bottom_radius,

crates/bevy_pbr/src/medium.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1+
use alloc::{borrow::Cow, sync::Arc};
12
use core::f32::{self, consts::PI};
2-
use std::{borrow::Cow, fs::canonicalize, mem, sync::Arc};
33

44
use bevy_app::{App, Plugin};
5-
use bevy_asset::{Asset, AssetApp, AssetId, Assets, Handle};
6-
use bevy_color::{Color, LinearRgba};
5+
use bevy_asset::{Asset, AssetApp, AssetId};
76
use bevy_ecs::{
87
resource::Resource,
98
system::{Commands, Res, SystemParamItem},
109
};
11-
use bevy_math::{
12-
curve::{EaseFunction, EasingCurve, Interval},
13-
ops, Curve, FloatPow, U8Vec3, Vec3, Vec4, VectorSpace,
14-
};
10+
use bevy_math::{ops, Curve, FloatPow, Vec3, Vec4};
1511
use bevy_reflect::TypePath;
1612
use bevy_render::{
1713
render_asset::{PrepareAssetError, RenderAsset, RenderAssetPlugin},
@@ -23,7 +19,7 @@ use bevy_render::{
2319
renderer::{RenderDevice, RenderQueue},
2420
RenderApp, RenderStartup,
2521
};
26-
use smallvec::{smallvec_inline, SmallVec};
22+
use smallvec::SmallVec;
2723

2824
#[doc(hidden)]
2925
pub struct ScatteringMediumPlugin;
@@ -143,13 +139,13 @@ impl ScatteringMedium {
143139
ScatteringTerm {
144140
absorption: Vec3::ZERO,
145141
scattering: Vec3::new(5.802e-6, 13.558e-6, 33.100e-6),
146-
falloff: Falloff::Exponential { scale: 12.5 }, //TODO: check if matches reference
142+
falloff: Falloff::Exponential { scale: 12.5 },
147143
phase: PhaseFunction::Rayleigh,
148144
},
149145
ScatteringTerm {
150146
absorption: Vec3::splat(3.996e-6),
151147
scattering: Vec3::splat(0.444e-6),
152-
falloff: Falloff::Exponential { scale: 83.5 }, //TODO: check if matches reference
148+
falloff: Falloff::Exponential { scale: 83.5 },
153149
phase: PhaseFunction::Mie { bias: 0.8 },
154150
},
155151
ScatteringTerm {

examples/3d/atmosphere.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use bevy::{
66
camera::Exposure,
77
core_pipeline::{bloom::Bloom, tonemapping::Tonemapping},
88
light::{light_consts::lux, AtmosphereEnvironmentMapLight, CascadeShadowConfigBuilder},
9-
pbr::{Atmosphere, AtmosphereSettings, EarthAtmosphere},
9+
pbr::{AtmosphereSettings, EarthAtmosphere},
1010
prelude::*,
1111
};
1212

0 commit comments

Comments
 (0)