From 16762906a707d3bdea0ef393089145621157e246 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sun, 4 Jun 2023 16:22:58 -0500 Subject: [PATCH] fix: Remaining scanlines, not completed I forgot I reversed the range. Didn't notice until I tried out a 1920x1080 render and realized it was counting *up* when it said "remainding." --- src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1331139..52302d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,14 +29,14 @@ fn main() { (400.0 / aspect_ratio) as i32 ); let samples_per_pixel = 100; - let max_depth = 100; + let max_depth = 50; // world let mat_ground = Material::Lambertian{ albedo: Vec3::new(0.8, 0.8, 0.0) }; let mat_center = Material::Lambertian{ albedo: Vec3::new(0.7, 0.3, 0.3) }; - let mat_left = Material::Metal{ albedo: Vec3::new(0.8, 0.8, 0.8) }; - let mat_right = Material::Metal{ albedo: Vec3::new(0.8, 0.6, 0.2) }; + let mat_left = Material::Metal{ albedo: Vec3::new(0.8, 0.8, 0.8), fuzz: 0.3 }; + let mat_right = Material::Metal{ albedo: Vec3::new(0.8, 0.6, 0.2), fuzz: 1.0 }; let mut world = HittableList::new(); world.add( @@ -64,8 +64,7 @@ fn main() { Sphere{ center: Vec3::new(-1.0, 0.0, -1.0), radius: 0.5, - material: Some(mat_left), - } + material: Some(mat_left), } ) ); @@ -88,7 +87,7 @@ fn main() { let distrib = Uniform::new(0.0, 1.0); println!("P3\n{} {}\n255", image.0, image.1); for y in (0..image.1).rev() { - eprintln!("Scanlines remaining: {}", image.1 - y); + eprintln!("Scanlines remaining: {}", y); for x in 0..image.0 { let mut color = Vec3::zero(); for _ in 0..samples_per_pixel {