From 89a5c9a8a0cdf627cda0e31da454f83ca21315ce Mon Sep 17 00:00:00 2001 From: lamp Date: Sun, 21 Jan 2024 16:40:16 +0000 Subject: implement beer's law for colourful dielectrics --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index c99ca58..0fe2df9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ use camera::Camera; use hittable::Hittable; use display::{Display, Image, Pixelflut}; use ray::Ray; -use vec3::{Vec3, Color}; +use vec3::{Vec3, Color, Point3}; use scenes::get_scene; struct PixelUpdate { @@ -33,7 +33,7 @@ fn ray_color(ray: &Ray, background: &Color, world: &dyn Hittable, depth: u32) -> } match world.hit(ray, 0.001, f64::INFINITY) { None => background.clone(), - Some(rec) => { + Some(mut rec) => { let mut scattered = Ray::new(); let mut attenuation = Color::new(); if let Some(material) = &rec.material { @@ -70,7 +70,7 @@ fn main() { //const ASPECT_RATIO: f64 = 1.0; const IMAGE_WIDTH: u32 = 600; const IMAGE_HEIGHT: u32 = (IMAGE_WIDTH as f64 / ASPECT_RATIO) as u32; - const SAMPLES_PER_PIXEL: u32 = 500; + const SAMPLES_PER_PIXEL: u32 = 30; const MAX_DEPTH: u32 = 50; const THREAD_COUNT: u32 = 8; const TIME_START: f64 = 0.0; -- cgit v1.2.3