Misc cleanup.
Correct aperture on final scene. Change default to perlin_debug for further investigation. Correct progress output in render.
This commit is contained in:
parent
d40cb0418f
commit
2d6accbc58
@ -91,7 +91,7 @@ pub struct Opt {
|
|||||||
pub subsamples: usize,
|
pub subsamples: usize,
|
||||||
/// Select scene to render, one of: "bench", "book", "tutorial", "bvh", "test", "cornell_box",
|
/// Select scene to render, one of: "bench", "book", "tutorial", "bvh", "test", "cornell_box",
|
||||||
/// "cornell_smoke", "perlin_debug", "final"
|
/// "cornell_smoke", "perlin_debug", "final"
|
||||||
#[structopt(long = "model", default_value = "final")]
|
#[structopt(long = "model", default_value = "perlin_debug")]
|
||||||
pub model: Model,
|
pub model: Model,
|
||||||
/// Path to store pprof profile data, i.e. /tmp/cpuprofile.pprof
|
/// Path to store pprof profile data, i.e. /tmp/cpuprofile.pprof
|
||||||
#[structopt(long = "pprof", parse(from_os_str))]
|
#[structopt(long = "pprof", parse(from_os_str))]
|
||||||
@ -204,7 +204,7 @@ pub fn render(
|
|||||||
|
|
||||||
println!("Rendering with {} subsamples", scene.subsamples);
|
println!("Rendering with {} subsamples", scene.subsamples);
|
||||||
let mut img = RgbImage::new(scene.width as u32, scene.height as u32);
|
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;
|
acc_count += 1;
|
||||||
pixel_data.iter().enumerate().for_each(|(idx, p)| {
|
pixel_data.iter().enumerate().for_each(|(idx, p)| {
|
||||||
let x = idx % scene.width;
|
let x = idx % scene.width;
|
||||||
@ -226,8 +226,8 @@ pub fn render(
|
|||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
if subsample % 10 == 0 {
|
if acc_count % 10 == 0 {
|
||||||
print!("{}", subsample);
|
print!("{}", acc_count);
|
||||||
} else {
|
} else {
|
||||||
print!(".");
|
print!(".");
|
||||||
}
|
}
|
||||||
@ -239,6 +239,8 @@ pub fn render(
|
|||||||
.unwrap_or_else(|_| panic!("Failed save {}", path.to_string_lossy()));
|
.unwrap_or_else(|_| panic!("Failed save {}", path.to_string_lossy()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
println!();
|
||||||
|
io::stdout().flush().unwrap();
|
||||||
let path = output_dir.join("final.png");
|
let path = output_dir.join("final.png");
|
||||||
// Write the contents of this image to the Writer in PNG format.
|
// Write the contents of this image to the Writer in PNG format.
|
||||||
trace!(target: "renderer", "Saving {}", path.to_string_lossy());
|
trace!(target: "renderer", "Saving {}", path.to_string_lossy());
|
||||||
|
|||||||
@ -31,7 +31,7 @@ pub fn new(opt: &Opt) -> Scene {
|
|||||||
let lookfrom = Vec3::new(478., 278., -600.);
|
let lookfrom = Vec3::new(478., 278., -600.);
|
||||||
let lookat = Vec3::new(278., 278., 0.);
|
let lookat = Vec3::new(278., 278., 0.);
|
||||||
let dist_to_focus = 10.;
|
let dist_to_focus = 10.;
|
||||||
let aperture = 0.1;
|
let aperture = 0.0;
|
||||||
let t_min = 0.;
|
let t_min = 0.;
|
||||||
let t_max = 1.;
|
let t_max = 1.;
|
||||||
let camera = Camera::new(
|
let camera = Camera::new(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user