diff options
author | lamp | 2024-01-21 16:40:16 +0000 |
---|---|---|
committer | lamp | 2024-01-21 16:40:16 +0000 |
commit | 89a5c9a8a0cdf627cda0e31da454f83ca21315ce (patch) | |
tree | 8da94d4b9bf1cd61353f278a94312719d60b306e /src/main.rs | |
parent | c0fc3926e06acddcc02ef086fbda688d4709e5ba (diff) |
implement beer's law for colourful dielectrics
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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; |