From 351bbcfe87eff3708946d8fb3caf7f826bbd715e Mon Sep 17 00:00:00 2001 From: Faerbit Date: Tue, 9 Jun 2020 21:39:28 +0200 Subject: [PATCH] Generate less moving spheres. --- main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index aea607f..f2ce875 100644 --- a/main.cpp +++ b/main.cpp @@ -48,12 +48,18 @@ Bvh_node setup_random_scene(const int sph_i) { if ((center - Point3(4, 0.2, 0)).length() > 0.9) { std::shared_ptr sphere_material; - if (choose_mat < 0.7) { - // diffuse + if (choose_mat < 0.2) { + // diffuse moving auto albedo = Color::random() * Color::random(); sphere_material = std::make_shared(albedo); auto center2 = center + Vec3(0, random_double(0, 0.5), 0); world.add(std::make_shared(center, center2, 0.0, 1.0, 0.2, sphere_material)); + } + if (choose_mat < 0.7) { + // diffuse + auto albedo = Color::random() * Color::random(); + sphere_material = std::make_shared(albedo); + world.add(std::make_shared(center, 0.2, sphere_material)); } else if (choose_mat < 0.95) { // metal auto albedo = Color::random(0.5, 1);