From 2d6accbc580ae884a1e9f3a8abcec1cfd8d04eba Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sat, 6 Oct 2018 08:45:50 -0700 Subject: [PATCH] Misc cleanup. Correct aperture on final scene. Change default to perlin_debug for further investigation. Correct progress output in render. --- rtiow/src/renderer.rs | 10 ++++++---- rtiow/src/scenes/final_scene.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rtiow/src/renderer.rs b/rtiow/src/renderer.rs index c603b92..c9ceba7 100644 --- a/rtiow/src/renderer.rs +++ b/rtiow/src/renderer.rs @@ -91,7 +91,7 @@ pub struct Opt { pub subsamples: usize, /// Select scene to render, one of: "bench", "book", "tutorial", "bvh", "test", "cornell_box", /// "cornell_smoke", "perlin_debug", "final" - #[structopt(long = "model", default_value = "final")] + #[structopt(long = "model", default_value = "perlin_debug")] pub model: Model, /// Path to store pprof profile data, i.e. /tmp/cpuprofile.pprof #[structopt(long = "pprof", parse(from_os_str))] @@ -204,7 +204,7 @@ pub fn render( println!("Rendering with {} subsamples", scene.subsamples); let mut img = RgbImage::new(scene.width as u32, scene.height as u32); - for (subsample, pixel_data) in pixel_data_rx { + for (_subsample, pixel_data) in pixel_data_rx { acc_count += 1; pixel_data.iter().enumerate().for_each(|(idx, p)| { let x = idx % scene.width; @@ -226,8 +226,8 @@ pub fn render( ]), ); }); - if subsample % 10 == 0 { - print!("{}", subsample); + if acc_count % 10 == 0 { + print!("{}", acc_count); } else { print!("."); } @@ -239,6 +239,8 @@ pub fn render( .unwrap_or_else(|_| panic!("Failed save {}", path.to_string_lossy())); } } + println!(); + io::stdout().flush().unwrap(); let path = output_dir.join("final.png"); // Write the contents of this image to the Writer in PNG format. trace!(target: "renderer", "Saving {}", path.to_string_lossy()); diff --git a/rtiow/src/scenes/final_scene.rs b/rtiow/src/scenes/final_scene.rs index 8143e95..5d6fc7a 100644 --- a/rtiow/src/scenes/final_scene.rs +++ b/rtiow/src/scenes/final_scene.rs @@ -31,7 +31,7 @@ pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(478., 278., -600.); let lookat = Vec3::new(278., 278., 0.); let dist_to_focus = 10.; - let aperture = 0.1; + let aperture = 0.0; let t_min = 0.; let t_max = 1.; let camera = Camera::new(