high quality

This commit is contained in:
Jonathan Flueren 2022-07-05 16:13:22 +02:00
parent 8f6ab08411
commit 89bcc587d2

View file

@ -146,9 +146,9 @@ fn main() {
// Image // Image
let aspect_ratio = 16.0 / 9.0; let aspect_ratio = 16.0 / 9.0;
let image_width = 400; let image_width = 1920;
let image_height = (image_width as f64 / aspect_ratio) as u32; let image_height = (image_width as f64 / aspect_ratio) as u32;
let samples_per_pixel = 100_u32; let samples_per_pixel = 200_u32;
let max_depth = 50; let max_depth = 50;
let vfov = 25.0; let vfov = 25.0;
@ -182,7 +182,8 @@ fn main() {
let atomic_counter = Arc::new(AtomicU32::new(0)); let atomic_counter = Arc::new(AtomicU32::new(0));
let color_lines: Vec<_> = (0..image_height) let color_lines: Vec<_> = (0..image_height)
.into_par_iter() .into_par_iter() // threadded/parallel variant
//.into_iter() // iterative variant
.rev() .rev()
.map(|j| { .map(|j| {
let v = atomic_counter.fetch_add(1, Ordering::Relaxed); let v = atomic_counter.fetch_add(1, Ordering::Relaxed);