diff --git a/src/assembly.rs b/src/assembly.rs index 2728742..f6f1918 100644 --- a/src/assembly.rs +++ b/src/assembly.rs @@ -197,7 +197,6 @@ impl AssemblyBuilder { let object_accel = BVH::from_objects(&mut self.instances[..], 1, |inst| &bbs[bis[inst.id]..bis[inst.id + 1]]); - println!("Assembly BVH Depth: {}", object_accel.tree_depth()); // Get list of instances that are for light sources. // TODO: include assemblies that themselves contain light sources. diff --git a/src/camera.rs b/src/camera.rs index fd40eb8..c000956 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -39,7 +39,9 @@ impl Camera { // Can't have focus distance of zero. if focus_distances.iter().any(|d| *d == 0.0) { - println!("WARNING: camera focal distance is zero or less. Disabling focal blur."); + if aperture_radii.iter().any(|a| *a > 0.0) { + println!("WARNING: camera focal distance is zero or less. Disabling focal blur."); + } aperture_radii = vec![0.0]; focus_distances = vec![1.0]; } diff --git a/src/main.rs b/src/main.rs index 0f54061..4af43c8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,6 +61,7 @@ Psychopath Usage: psychopath [options] -i + psychopath --dev psychopath (-h | --help) psychopath --version @@ -69,6 +70,7 @@ Options: -s , --spp Number of samples per pixel. -t , --threads Number of threads to render with. Defaults to the number of logical cores on the system. + --dev Show useful dev/debug info. -h, --help Show this screen. --version Show version. "#; @@ -78,6 +80,7 @@ struct Args { flag_input: Option, flag_spp: Option, flag_threads: Option, + flag_dev: bool, flag_version: bool, } @@ -99,11 +102,15 @@ fn main() { } // Print some misc useful dev info. - println!("Ray size: {} bytes", mem::size_of::()); - println!("AccelRay size: {} bytes", mem::size_of::()); - println!("LightPath size: {} bytes", mem::size_of::()); + if args.flag_dev { + println!("Ray size: {} bytes", mem::size_of::()); + println!("AccelRay size: {} bytes", mem::size_of::()); + println!("LightPath size: {} bytes", mem::size_of::()); + return; + } // Parse data tree of scene file + println!("Parsing scene file..."); t.tick(); let mut s = String::new(); let dt = if let Some(fp) = args.flag_input { @@ -114,7 +121,7 @@ fn main() { } else { panic!() }; - println!("Parsed scene file in {:.3}s\n", t.tick()); + println!("\tParsed scene file in {:.3}s", t.tick()); // Iterate through scenes and render them @@ -126,7 +133,7 @@ fn main() { let mut r = parse_scene(child).unwrap(); if let Some(spp) = args.flag_spp { - println!("Overriding scene spp: {}", spp); + println!("\tOverriding scene spp: {}", spp); r.spp = spp; } @@ -136,11 +143,11 @@ fn main() { num_cpus::get() as u32 }; - println!("Built scene in {:.3}s\n", t.tick()); + println!("\tBuilt scene in {:.3}s", t.tick()); println!("Rendering scene with {} threads...", thread_count); r.render(thread_count); - println!("Rendered scene in {:.3}s", t.tick()); + println!("\tRendered scene in {:.3}s", t.tick()); } } } diff --git a/src/renderer.rs b/src/renderer.rs index 4f82570..28a6937 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -218,8 +218,8 @@ impl Renderer { // Write rendered image to disk let _ = image.write_png(Path::new(&self.output_file)); - // End output with a new line - println!(""); + // Clear percentage progress print + print!("\r \r"); } }