Skip to content

Commit

Permalink
Cleanup clearcoat example (#15594)
Browse files Browse the repository at this point in the history
The components needed for `DirectionalLight` are added automatically
since #15554
`create_point_light` already existed and returns a `PointLight` with
these same settings
  • Loading branch information
tim-blackbird authored Oct 2, 2024
1 parent 59db6f9 commit ca709ff
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions examples/3d/clearcoat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ca709ff

Please sign in to comment.