Generate less moving spheres.

This commit is contained in:
Faerbit 2020-06-09 21:39:28 +02:00
parent ce102449b8
commit 351bbcfe87

View File

@ -48,12 +48,18 @@ Bvh_node setup_random_scene(const int sph_i) {
if ((center - Point3(4, 0.2, 0)).length() > 0.9) { if ((center - Point3(4, 0.2, 0)).length() > 0.9) {
std::shared_ptr<Material> sphere_material; std::shared_ptr<Material> sphere_material;
if (choose_mat < 0.7) { if (choose_mat < 0.2) {
// diffuse // diffuse moving
auto albedo = Color::random() * Color::random(); auto albedo = Color::random() * Color::random();
sphere_material = std::make_shared<Lambertian>(albedo); sphere_material = std::make_shared<Lambertian>(albedo);
auto center2 = center + Vec3(0, random_double(0, 0.5), 0); auto center2 = center + Vec3(0, random_double(0, 0.5), 0);
world.add(std::make_shared<Moving_sphere>(center, center2, 0.0, 1.0, 0.2, sphere_material)); world.add(std::make_shared<Moving_sphere>(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<Lambertian>(albedo);
world.add(std::make_shared<Sphere>(center, 0.2, sphere_material));
} else if (choose_mat < 0.95) { } else if (choose_mat < 0.95) {
// metal // metal
auto albedo = Color::random(0.5, 1); auto albedo = Color::random(0.5, 1);