Cleanup clearcoat example (#15594)

The components needed for `DirectionalLight` are added automatically
since #15554
`create_point_light` already existed and returns a `PointLight` with
these same settings
This commit is contained in:
Tim 2024-10-02 16:15:27 +00:00 committed by GitHub
parent 59db6f9cca
commit ca709ffb5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,9 +23,8 @@ use bevy::{
color::palettes::css::{BLUE, GOLD, WHITE},
core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox},
math::vec3,
pbr::{CascadeShadowConfig, Cascades, CascadesVisibleEntities},
prelude::*,
render::{primitives::CascadesFrusta, texture::ImageLoaderSettings},
render::texture::ImageLoaderSettings,
};
/// The size of each sphere.
@ -184,19 +183,7 @@ fn spawn_scratched_gold_ball(
/// Spawns a light.
fn spawn_light(commands: &mut Commands) {
commands.spawn((
PointLight {
color: WHITE.into(),
intensity: 100000.0,
..default()
},
// Add the cascades objects used by the `DirectionalLight`, since the
// user can toggle between a point light and a directional light.
CascadesFrusta::default(),
Cascades::default(),
CascadeShadowConfig::default(),
CascadesVisibleEntities::default(),
));
commands.spawn(create_point_light());
}
/// Spawns a camera with associated skybox and environment map.