Skip to content

Commit

Permalink
vary key PBR parameters on a grid of spheres to show the effect
Browse files Browse the repository at this point in the history
  • Loading branch information
IngmarBitter committed Dec 29, 2020
1 parent ce80046 commit fb9fae0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Default for StandardMaterial {
fn default() -> Self {
StandardMaterial {
albedo: Color::rgb(1.0, 1.0, 1.0),
pbr: Vec2::new(1.0, 0.95), //(0.01, 0.08),
pbr: Vec2::new(1.0, 0.95),
albedo_texture: None,
shaded: true,
}
Expand Down
8 changes: 7 additions & 1 deletion examples/3d/pbr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ fn setup(
// add entities to the world
for y in -2..=2 {
for x in -5..=5 {
let x01 = x as f32 / 10.0 + 0.5;
let y01 = y as f32 / 2.0 + 0.5;
commands
// spheres
.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Icosphere {
radius: 0.45,
subdivisions: 32,
})),
material: materials.add(Color::rgb(0.2, 0.2, 1.0).into()),
material: materials.add(StandardMaterial {
albedo: Color::rgb(0.2, 0.2, 1.0),
pbr: Vec2::new(x01, y01), // vary key PBR parameters on a grid of spheres to show the effect
..Default::default()
}),
transform: Transform::from_translation(Vec3::new(x as f32, y as f32, 0.0)),
..Default::default()
});
Expand Down

0 comments on commit fb9fae0

Please sign in to comment.