Generate less moving spheres.
This commit is contained in:
parent
ce102449b8
commit
351bbcfe87
10
main.cpp
10
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<Material> 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<Lambertian>(albedo);
|
||||
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));
|
||||
}
|
||||
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) {
|
||||
// metal
|
||||
auto albedo = Color::random(0.5, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user