Skip to content

Commit

Permalink
wgpu engine demo less spheres
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Aug 6, 2023
1 parent 1e6e405 commit e3c18c4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions wgpu_engine_demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,18 @@ impl State {
meshes.push(i.build(gfx).unwrap());
}

for x in 0..=10 {
for z in 0..=10 {
const N_MET: i32 = 5;
const N_ROUGH: i32 = 10;
for x in 0..N_ROUGH {
for z in 0..N_MET {
let mut c = mesh.clone();

c.materials[0].0 = gfx.register_material(Material::new_raw(
&gfx.device,
alb.clone(),
MetallicRoughness {
metallic: z as f32 / 10.0,
roughness: x as f32 / 10.0,
metallic: z as f32 / (N_MET as f32 - 1.0),
roughness: x as f32 / (N_ROUGH as f32 - 1.0),
tex: None,
},
None,
Expand Down

0 comments on commit e3c18c4

Please sign in to comment.