Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Nov 3, 2023
1 parent 8686330 commit b153c98
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 49 deletions.
Binary file added assets/branding/bevy_bird_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 135 additions & 0 deletions assets/branding/bevy_bird_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion crates/bevy_core_pipeline/src/clear_color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pub enum ClearColorConfig {
#[reflect(Resource)]
pub struct ClearColor(pub Color);

/// Match the dark gray bevy website code block color by default.
impl Default for ClearColor {
fn default() -> Self {
// Match the bevy website code block color by default.
Self(Color::rgb_u8(43, 44, 47))
}
}
1 change: 1 addition & 0 deletions example_showcase_config.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(exit_after: Some(250))
2 changes: 1 addition & 1 deletion examples/2d/bloom_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn setup(

// Sprite
commands.spawn(SpriteBundle {
texture: asset_server.load("branding/icon.png"),
texture: asset_server.load("branding/bevy_bird_light.png"),
sprite: Sprite {
color: Color::rgb(5.0, 5.0, 5.0), // 4. Put something bright in a dark environment to see the effect
custom_size: Some(Vec2::splat(160.0)),
Expand Down
2 changes: 1 addition & 1 deletion examples/2d/sprite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(SpriteBundle {
texture: asset_server.load("branding/icon.png"),
texture: asset_server.load("branding/bevy_bird_light.png"),
..default()
});
}
2 changes: 1 addition & 1 deletion examples/2d/sprite_flipping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(SpriteBundle {
texture: asset_server.load("branding/icon.png"),
texture: asset_server.load("branding/bevy_bird_light.png"),
sprite: Sprite {
// Flip the logo to the left
flip_x: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/3d_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn setup(
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
// plane
// circular base
commands.spawn(PbrBundle {
mesh: meshes.add(shape::Circle::new(4.0).into()),
material: materials.add(Color::WHITE.into()),
Expand Down
16 changes: 14 additions & 2 deletions examples/3d/anti_aliasing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ fn setup(
) {
// Plane
commands.spawn(PbrBundle {
mesh: meshes.add(shape::Plane::from_size(5.0).into()),
material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
mesh: meshes.add(shape::Plane::from_size(50.0).into()),
material: materials.add(Color::GRAY.into()),
..default()
});

Expand Down Expand Up @@ -325,6 +325,18 @@ fn setup(
enabled: false,
..default()
},
EnvironmentMapLight {
diffuse_map: asset_server.load("environment_maps/pisa_diffuse_rgb9e5_zstd.ktx2"),
specular_map: asset_server.load("environment_maps/pisa_specular_rgb9e5_zstd.ktx2"),
},
FogSettings {
color: Color::rgba_u8(43, 44, 47, 255),
falloff: FogFalloff::Linear {
start: 1.0,
end: 4.0,
},
..default()
},
));

// example instructions
Expand Down
6 changes: 3 additions & 3 deletions examples/3d/deferred_rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn setup(
..default()
},
FogSettings {
color: Color::rgba(0.25, 0.25, 0.25, 1.0),
color: Color::rgba_u8(43, 44, 47, 255),
falloff: FogFalloff::Linear {
start: 1.0,
end: 8.0,
Expand Down Expand Up @@ -93,11 +93,11 @@ fn setup(
});
commands.spawn(SceneBundle {
scene: helmet_scene,
transform: Transform::from_xyz(-3.0, 0.0, -3.0),
transform: Transform::from_xyz(-4.0, 0.0, -3.0),
..default()
});

let mut forward_mat: StandardMaterial = Color::rgb(0.1, 0.2, 0.1).into();
let mut forward_mat: StandardMaterial = Color::GRAY.into();
forward_mat.opaque_render_method = OpaqueRendererMethod::Forward;
let forward_mat_h = materials.add(forward_mat);

Expand Down
4 changes: 0 additions & 4 deletions examples/3d/load_gltf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ use std::f32::consts::*;

fn main() {
App::new()
.insert_resource(AmbientLight {
color: Color::WHITE,
brightness: 1.0 / 5.0f32,
})
.insert_resource(DirectionalLightShadowMap { size: 4096 })
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
Expand Down
30 changes: 13 additions & 17 deletions examples/3d/spotlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ use rand::{rngs::StdRng, Rng, SeedableRng};

fn main() {
App::new()
.insert_resource(AmbientLight {
brightness: 0.02,
..default()
})
.add_plugins((
DefaultPlugins,
FrameTimeDiagnosticsPlugin,
LogDiagnosticsPlugin::default(),
bevy_internal::core_pipeline::experimental::taa::TemporalAntiAliasPlugin,
))
.add_systems(Startup, setup)
.add_systems(Update, (light_sway, movement))
Expand All @@ -31,21 +36,14 @@ fn setup(
// ground plane
commands.spawn(PbrBundle {
mesh: meshes.add(shape::Plane::from_size(100.0).into()),
material: materials.add(StandardMaterial {
base_color: Color::GREEN,
perceptual_roughness: 1.0,
..default()
}),
material: materials.add(Color::WHITE.into()),
..default()
});

// cubes
let mut rng = StdRng::seed_from_u64(19878367467713);
let cube_mesh = meshes.add(Mesh::from(shape::Cube { size: 0.5 }));
let blue = materials.add(StandardMaterial {
base_color: Color::BLUE,
..default()
});
let blue = materials.add(Color::rgb_u8(124, 144, 255).into());
for _ in 0..40 {
let x = rng.gen_range(-5.0..5.0);
let y = rng.gen_range(0.0..3.0);
Expand All @@ -61,12 +59,6 @@ fn setup(
));
}

// ambient light
commands.insert_resource(AmbientLight {
color: Color::rgb(0.0, 1.0, 1.0),
brightness: 0.14,
});

let sphere_mesh = meshes.add(Mesh::from(shape::UVSphere {
radius: 0.05,
..default()
Expand Down Expand Up @@ -124,10 +116,14 @@ fn setup(
}

// camera
commands.spawn(Camera3dBundle {
commands.spawn((Camera3dBundle {
camera: Camera {
hdr: true,
..default()
},
transform: Transform::from_xyz(-4.0, 5.0, 10.0).looking_at(Vec3::ZERO, Vec3::Y),
..default()
});
},));
}

fn light_sway(time: Res<Time>, mut query: Query<(&mut Transform, &mut SpotLight)>) {
Expand Down
19 changes: 10 additions & 9 deletions examples/3d/tonemapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ fn setup(
transform: camera_transform.0,
..default()
},
FogSettings {
color: Color::rgba_u8(43, 44, 47, 255),
falloff: FogFalloff::Linear {
start: 1.0,
end: 8.0,
},
..default()
},
EnvironmentMapLight {
diffuse_map: asset_server.load("environment_maps/pisa_diffuse_rgb9e5_zstd.ktx2"),
specular_map: asset_server.load("environment_maps/pisa_specular_rgb9e5_zstd.ktx2"),
Expand Down Expand Up @@ -98,15 +106,8 @@ fn setup_basic_scene(
// plane
commands.spawn((
PbrBundle {
mesh: meshes.add(Mesh::from(shape::Plane {
size: 5.0,
..default()
})),
material: materials.add(StandardMaterial {
base_color: Color::rgb(0.3, 0.5, 0.3),
perceptual_roughness: 0.5,
..default()
}),
mesh: meshes.add(shape::Plane::from_size(50.0).into()),
material: materials.add(Color::GRAY.into()),
..default()
},
SceneNumber(1),
Expand Down
Loading

0 comments on commit b153c98

Please sign in to comment.