diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index a05c1c1..a21380f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,16 +25,18 @@ fn main() { let brown = Arc::new(Lambertian::new(Spectrum::new_rgb(0.5, 0.3, 0.0))); let blue = Arc::new(Lambertian::new(Spectrum::new_rgb(0.0, 0.3, 0.7))); let green = Arc::new(Lambertian::new(Spectrum::new_rgb(0.0, 0.7, 0.3))); - let metal = Arc::new(Dielectric::new(1.5)); - let sun = Arc::new(DiffuseLight::new_white(13.0)); + let metal = Arc::new(Reflectant::new(Spectrum::new_rgb(0.8, 0.8, 0.9), Some(1.0))); + let glass = Arc::new(Dielectric::new(1.5)); + let sun = Arc::new(DiffuseLight::new_white(50.0)); let mut scn = Scene::new(); scn.add_objects(vec![ - Object::new(metal, Sphere::new(0.2, Vector3f::new_xyz(0.0, 0.0, -1.0))), - Object::new(blue.clone(), Sphere::new(0.5, Vector3f::new_xyz(1.0, 0.0, -1.5))), + Object::new(glass, Sphere::new(0.2, Vector3f::new_xyz(0.0, 0.0, -1.0))), + Object::new(blue, Sphere::new(0.5, Vector3f::new_xyz(1.0, 0.0, -1.5))), Object::new(green, Sphere::new(0.3, Vector3f::new_xyz(0.5, 0.0, -2.5))), Object::new(brown, Sphere::new(100.0, Vector3f::new_xyz(0.0, -100.5, -1.0))), - Object::new(sun, Sphere::new(0.4, Vector3f::new_xyz(-1.0, 0.7, 0.0))), + Object::new(metal, Sphere::new(0.2, Vector3f::new_xyz(-0.5, 0.0, -1.0))), + Object::new(sun, Sphere::new(0.4, Vector3f::new_xyz(-1.0, 3.0, 0.0))), ]); let tracer = DefaultTracer::new(&scn, Some(50), @@ -48,7 +50,7 @@ fn main() { let mut film = Film::new(res); { - let coord = RenderCoord::new(&mut film, Vector2i::new_xy(64, 64), 50); + let coord = RenderCoord::new(&mut film, Vector2i::new_xy(50, 50), 1000); coord.run_threaded(&ctx, &mut sampler, 8); } |