From e3c18c402c14d01851f6f9482629e25822dba715 Mon Sep 17 00:00:00 2001 From: Paris DOUADY Date: Sun, 6 Aug 2023 09:42:48 +0200 Subject: [PATCH] wgpu engine demo less spheres --- wgpu_engine_demo/src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wgpu_engine_demo/src/main.rs b/wgpu_engine_demo/src/main.rs index bf427e0b..4a11059d 100644 --- a/wgpu_engine_demo/src/main.rs +++ b/wgpu_engine_demo/src/main.rs @@ -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,