mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
dc9b486650
# Objective Fix https://github.com/bevyengine/bevy/issues/11577. ## Solution Fix the examples, add a few constants to make setting light values easier, and change the default lighting settings to be more realistic. (Now designed for an overcast day instead of an indoor environment) --- I did not include any example-related changes in here. ## Changelogs (not including breaking changes) ### bevy_pbr - Added `light_consts` module (included in prelude), which contains common lux and lumen values for lights. - Added `AmbientLight::NONE` constant, which is an ambient light with a brightness of 0. - Added non-EV100 variants for `ExposureSettings`'s EV100 constants, which allow easier construction of an `ExposureSettings` from a EV100 constant. ## Breaking changes ### bevy_pbr The several default lighting values were changed: - `PointLight`'s default `intensity` is now `2000.0` - `SpotLight`'s default `intensity` is now `2000.0` - `DirectionalLight`'s default `illuminance` is now `light_consts::lux::OVERCAST_DAY` (`1000.`) - `AmbientLight`'s default `brightness` is now `20.0`
40 lines
1.4 KiB
Rust
40 lines
1.4 KiB
Rust
//! Hot reloading allows you to modify assets files to be immediately reloaded while your game is
|
|
//! running. This lets you immediately see the results of your changes without restarting the game.
|
|
//! This example illustrates hot reloading mesh changes.
|
|
//!
|
|
//! Note that hot asset reloading requires the [`AssetWatcher`](bevy::asset::io::AssetWatcher) to be enabled
|
|
//! for your current platform. For desktop platforms, enable the `file_watcher` cargo feature.
|
|
|
|
use bevy::prelude::*;
|
|
|
|
fn main() {
|
|
App::new()
|
|
.add_plugins(DefaultPlugins)
|
|
.add_systems(Startup, setup)
|
|
.run();
|
|
}
|
|
|
|
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|
// Load our mesh:
|
|
let scene_handle = asset_server.load("models/torus/torus.gltf#Scene0");
|
|
|
|
// Any changes to the mesh will be reloaded automatically! Try making a change to torus.gltf.
|
|
// You should see the changes immediately show up in your app.
|
|
|
|
// mesh
|
|
commands.spawn(SceneBundle {
|
|
scene: scene_handle,
|
|
..default()
|
|
});
|
|
// light
|
|
commands.spawn(DirectionalLightBundle {
|
|
directional_light: DirectionalLight::default(),
|
|
transform: Transform::from_xyz(4.0, 5.0, 4.0).looking_at(Vec3::ZERO, Vec3::Y),
|
|
..default()
|
|
});
|
|
// camera
|
|
commands.spawn(Camera3dBundle {
|
|
transform: Transform::from_xyz(2.0, 2.0, 6.0).looking_at(Vec3::ZERO, Vec3::Y),
|
|
..default()
|
|
});
|
|
}
|