Skip to content

Commit

Permalink
Add bevy logo to the lighting example to demo alpha mask shadows (#7895)
Browse files Browse the repository at this point in the history
  • Loading branch information
superdump committed Mar 4, 2023
1 parent 57bf771 commit f9226a3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/3d/lighting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fn setup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
asset_server: Res<AssetServer>,
) {
// ground plane
commands.spawn(PbrBundle {
Expand Down Expand Up @@ -61,6 +62,25 @@ fn setup(
..default()
});

// Bevy logo to demonstrate alpha mask shadows
let mut transform = Transform::from_xyz(-2.2, 0.5, 1.0);
transform.rotate_y(PI / 8.);
commands.spawn((
PbrBundle {
mesh: meshes.add(Mesh::from(shape::Quad::new(Vec2::new(2.0, 0.5)))),
transform,
material: materials.add(StandardMaterial {
base_color_texture: Some(asset_server.load("branding/bevy_logo_light.png")),
perceptual_roughness: 1.0,
alpha_mode: AlphaMode::Mask(0.5),
cull_mode: None,
..default()
}),
..default()
},
Movable,
));

// cube
commands.spawn((
PbrBundle {
Expand Down

0 comments on commit f9226a3

Please sign in to comment.