Skip to content

Commit

Permalink
Explain how AmbientLight is inserted and configured (bevyengine#10712)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg authored and Ray Redondo committed Jan 9, 2024
1 parent 0d4e57e commit 5538660
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 5538660

Please sign in to comment.