Skip to content

Commit

Permalink
Explain how AmbientLight is inserted and configured (#10712)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg authored Nov 24, 2023
1 parent e85af0e commit 790fafd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/bevy_pbr/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,20 @@ fn calculate_cascade(
}

/// An ambient light, which lights the entire scene equally.
///
/// This resource is inserted by the [`PbrPlugin`] and by default it is set to a low ambient light.
///
/// # Examples
///
/// Make ambient light slightly brighter:
///
/// ```
/// # use bevy_ecs::system::ResMut;
/// # use bevy_pbr::AmbientLight;
/// fn setup_ambient_light(mut ambient_light: ResMut<AmbientLight>) {
/// ambient_light.brightness = 0.3;
/// }
/// ```
#[derive(Resource, Clone, Debug, ExtractResource, Reflect)]
#[reflect(Resource)]
pub struct AmbientLight {
Expand Down

0 comments on commit 790fafd

Please sign in to comment.