Cleaned up console output.

This commit is contained in:
Nathan Vegdahl 2016-07-31 12:27:06 -07:00
parent c6f6266a38
commit 08576b9934
4 changed files with 19 additions and 11 deletions

View File

@ -197,7 +197,6 @@ impl AssemblyBuilder {
let object_accel = BVH::from_objects(&mut self.instances[..], let object_accel = BVH::from_objects(&mut self.instances[..],
1, 1,
|inst| &bbs[bis[inst.id]..bis[inst.id + 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. // Get list of instances that are for light sources.
// TODO: include assemblies that themselves contain light sources. // TODO: include assemblies that themselves contain light sources.

View File

@ -39,7 +39,9 @@ impl Camera {
// Can't have focus distance of zero. // Can't have focus distance of zero.
if focus_distances.iter().any(|d| *d == 0.0) { 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]; aperture_radii = vec![0.0];
focus_distances = vec![1.0]; focus_distances = vec![1.0];
} }

View File

@ -61,6 +61,7 @@ Psychopath <VERSION>
Usage: Usage:
psychopath [options] -i <file> psychopath [options] -i <file>
psychopath --dev
psychopath (-h | --help) psychopath (-h | --help)
psychopath --version psychopath --version
@ -69,6 +70,7 @@ Options:
-s <n>, --spp <n> Number of samples per pixel. -s <n>, --spp <n> Number of samples per pixel.
-t <n>, --threads <n> Number of threads to render with. Defaults -t <n>, --threads <n> Number of threads to render with. Defaults
to the number of logical cores on the system. to the number of logical cores on the system.
--dev Show useful dev/debug info.
-h, --help Show this screen. -h, --help Show this screen.
--version Show version. --version Show version.
"#; "#;
@ -78,6 +80,7 @@ struct Args {
flag_input: Option<String>, flag_input: Option<String>,
flag_spp: Option<usize>, flag_spp: Option<usize>,
flag_threads: Option<usize>, flag_threads: Option<usize>,
flag_dev: bool,
flag_version: bool, flag_version: bool,
} }
@ -99,11 +102,15 @@ fn main() {
} }
// Print some misc useful dev info. // Print some misc useful dev info.
println!("Ray size: {} bytes", mem::size_of::<Ray>()); if args.flag_dev {
println!("AccelRay size: {} bytes", mem::size_of::<AccelRay>()); println!("Ray size: {} bytes", mem::size_of::<Ray>());
println!("LightPath size: {} bytes", mem::size_of::<LightPath>()); println!("AccelRay size: {} bytes", mem::size_of::<AccelRay>());
println!("LightPath size: {} bytes", mem::size_of::<LightPath>());
return;
}
// Parse data tree of scene file // Parse data tree of scene file
println!("Parsing scene file...");
t.tick(); t.tick();
let mut s = String::new(); let mut s = String::new();
let dt = if let Some(fp) = args.flag_input { let dt = if let Some(fp) = args.flag_input {
@ -114,7 +121,7 @@ fn main() {
} else { } else {
panic!() 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 // Iterate through scenes and render them
@ -126,7 +133,7 @@ fn main() {
let mut r = parse_scene(child).unwrap(); let mut r = parse_scene(child).unwrap();
if let Some(spp) = args.flag_spp { if let Some(spp) = args.flag_spp {
println!("Overriding scene spp: {}", spp); println!("\tOverriding scene spp: {}", spp);
r.spp = spp; r.spp = spp;
} }
@ -136,11 +143,11 @@ fn main() {
num_cpus::get() as u32 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); println!("Rendering scene with {} threads...", thread_count);
r.render(thread_count); r.render(thread_count);
println!("Rendered scene in {:.3}s", t.tick()); println!("\tRendered scene in {:.3}s", t.tick());
} }
} }
} }

View File

@ -218,8 +218,8 @@ impl Renderer {
// Write rendered image to disk // Write rendered image to disk
let _ = image.write_png(Path::new(&self.output_file)); let _ = image.write_png(Path::new(&self.output_file));
// End output with a new line // Clear percentage progress print
println!(""); print!("\r \r");
} }
} }