From ff6b6191a432efe23c9ba146ba6a169197df5290 Mon Sep 17 00:00:00 2001 From: JonOfUs Date: Tue, 19 Jul 2022 17:51:59 +0200 Subject: [PATCH] Some more stuff with cat.obj --- Cargo.lock | 16 ++-------------- src/main.rs | 13 ++++++------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index adb0be3..7866e91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -152,15 +152,14 @@ dependencies = [ [[package]] name = "image" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28edd9d7bc256be2502e325ac0628bde30b7001b9b52e0abe31a1a9dc2701212" +checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" dependencies = [ "bytemuck", "byteorder", "color_quant", "jpeg-decoder", - "num-iter", "num-rational", "num-traits", "png", @@ -206,17 +205,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.1" diff --git a/src/main.rs b/src/main.rs index faf2967..13eb464 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,7 +173,7 @@ fn random_world() -> HittableList { fn from_obj(path: &str) -> HittableList { let mut world = HittableList::new(); - let material_ground = Arc::new(Lambertian::new(&Color::new(0.05, 0.05, 0.05))); + let material_ground = Arc::new(Lambertian::new(&Color::new(0.2, 0.2, 0.2))); world.add(Box::::new(Sphere::new( Point3::new(0.0, -50000.0, 0.0), 50000.0, @@ -189,10 +189,9 @@ fn from_obj(path: &str) -> HittableList { } }*/ - //let material = Arc::new(Lambertian::new(&Color::new(0.4, 0.2, 0.3))); - //let material = Arc::new(Dielectric::new(2.0)); - let material = Arc::new(Metal::new(&Color::new(0.9, 0.9, 0.7), 0.0)); - + let material = Arc::new(Lambertian::new(&Color::new(0.4, 0.2, 0.3))); + //let material = Arc::new(Dielectric::new(2.0)); + //let material = Arc::new(Metal::new(&Color::new(0.9, 0.9, 0.7), 0.0)); let cornell_box = tobj::load_obj(path, &tobj::GPU_LOAD_OPTIONS); let (models, materials) = cornell_box.expect("Failed to load OBJ file"); @@ -267,9 +266,9 @@ fn main() { // Image let aspect_ratio = 16.0 / 9.0; - let image_width = 1000; + let image_width = 700; let image_height = (image_width as f64 / aspect_ratio) as u32; - let samples_per_pixel = 25_u32; + let samples_per_pixel = 1_u32; let max_depth = 25; let vfov = 60.0;