From 284167f7c1f4ea36d2f5a2e5e4aa6c5c9e8618ff Mon Sep 17 00:00:00 2001 From: Jonathan Flueren <11487762+JonOfUs@users.noreply.github.com> Date: Thu, 23 Jun 2022 12:11:00 +0200 Subject: [PATCH] Some color tests --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3f6ef1d..3cb3f62 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,7 @@ fn main() { // Image let aspect_ratio = 16.0 / 9.0; - let image_width = 1920; + let image_width = 1000; let image_height = (image_width as f64 / aspect_ratio) as u32; let samples_per_pixel = 100_u32; let max_depth = 50; @@ -58,7 +58,7 @@ fn main() { // World let mut world = HittableList::new(); - let material_ground = Arc::new(Lambertian::new(&Color::new(0.8, 0.8, 0.0))); + let material_ground = Arc::new(Lambertian::new(&Color::new(0.2, 0.3, 0.0))); let material_center = Arc::new(Lambertian::new(&Color::new(0.7, 0.1, 0.2))); //let material_center = Arc::new(Dielectric::new(1.5)); let material_blue = Arc::new(Lambertian::new(&Color::new(0.2, 0.1, 0.7))); @@ -66,6 +66,7 @@ fn main() { let material_metal_fuzz = Arc::new(Metal::new(&Color::new(0.8, 0.8, 0.8), 1.0)); let material_mirror = Arc::new(Metal::new(&Color::new(0.8, 0.8, 0.8), 0.0)); let material_dielectric = Arc::new(Dielectric::new(1.5)); + let material_light = Arc::new(Lambertian::new(&Color::new(2.0, 1.0, 0.0))); @@ -99,6 +100,11 @@ fn main() { 1.0, material_blue.clone(), ))); + world.add(Box::::new(Sphere::new( + Point3::new(0.5, 1.0, 0.3), + 0.3, + material_light.clone(), + ))); /* for i in -15..15 { for j in -15..15 {