Cleaned up console output.
This commit is contained in:
parent
c6f6266a38
commit
08576b9934
|
@ -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.
|
||||
|
|
|
@ -39,7 +39,9 @@ impl Camera {
|
|||
|
||||
// Can't have focus distance of zero.
|
||||
if focus_distances.iter().any(|d| *d == 0.0) {
|
||||
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];
|
||||
}
|
||||
|
|
15
src/main.rs
15
src/main.rs
|
@ -61,6 +61,7 @@ Psychopath <VERSION>
|
|||
|
||||
Usage:
|
||||
psychopath [options] -i <file>
|
||||
psychopath --dev
|
||||
psychopath (-h | --help)
|
||||
psychopath --version
|
||||
|
||||
|
@ -69,6 +70,7 @@ Options:
|
|||
-s <n>, --spp <n> Number of samples per pixel.
|
||||
-t <n>, --threads <n> 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<String>,
|
||||
flag_spp: Option<usize>,
|
||||
flag_threads: Option<usize>,
|
||||
flag_dev: bool,
|
||||
flag_version: bool,
|
||||
}
|
||||
|
||||
|
@ -99,11 +102,15 @@ fn main() {
|
|||
}
|
||||
|
||||
// Print some misc useful dev info.
|
||||
if args.flag_dev {
|
||||
println!("Ray size: {} bytes", mem::size_of::<Ray>());
|
||||
println!("AccelRay size: {} bytes", mem::size_of::<AccelRay>());
|
||||
println!("LightPath size: {} bytes", mem::size_of::<LightPath>());
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user