summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--img/output.pngbin129953 -> 325176 bytes
-rw-r--r--src/common.rs6
-rw-r--r--src/main.rs7
3 files changed, 7 insertions, 6 deletions
diff --git a/img/output.png b/img/output.png
index 8ccf097..02e484f 100644
--- a/img/output.png
+++ b/img/output.png
Binary files differ
diff --git a/src/common.rs b/src/common.rs
index 4ea9e72..3e606b1 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -3,13 +3,13 @@ use crate::calculus::Interval;
// "Ideal" aspect ratio, allowing fraction
pub const ASPECT_RATIO: f32 = 16.0 / 9.0;
-pub const IMG_WIDTH: usize = 400;
+pub const IMG_WIDTH: usize = 800;
pub const IMG_HEIGHT: usize = get_image_height(IMG_WIDTH, ASPECT_RATIO);
-pub const SAMPLES_PER_PIXEL: usize = 100;
+pub const SAMPLES_PER_PIXEL: usize = 500;
pub const MAX_DEPTH: usize = 50;
-pub const VFOV: f32 = 30.0;
+pub const VFOV: f32 = 60.0;
pub const LOOK_FROM: Point3 = Point3 { x: -2.0, y: 2.0, z: 1.0 };
pub const LOOK_AT: Point3 = Point3 { x: 0.0, y: 0.0, z: -1.0 };
pub const VUP: Vec3 = Vec3 { x: 0.0, y: 1.0, z: 0.0 };
diff --git a/src/main.rs b/src/main.rs
index 69542fb..386810e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -21,6 +21,7 @@ fn main() {
let steel = Material::new(Color::from_name(ColorName::Silver), MaterialType::Metallic(0.1));
// let gold = Material::new(Color::from_name(ColorName::Yellow), MaterialType::Metallic(0.0));
let glass = Material::new(Color::from_name(ColorName::White), MaterialType::Transparent(1.5));
+ let yellow_glass = Material::new(Color::from_name(ColorName::Lime), MaterialType::Transparent(1.6));
let rare_metal = Material::new(Color::from_name(ColorName::Red), MaterialType::Metallic(0.0));
world.push(
@@ -30,16 +31,16 @@ fn main() {
Sphere::new(Point3::new(0.0, 0.0, -1.0), 0.5, stone)
);
world.push(
- Sphere::new(Point3::new(-1.0, 0.0, -1.0), 0.5, glass.clone())
+ Sphere::new(Point3::new(-1.0, 0.1, -0.5), 0.6, yellow_glass)
);
world.push(
Sphere::new(Point3::new(1.0, 0.0, -1.0), 0.5, steel)
);
world.push(
- Sphere::new(Point3::new(1.0, -0.3, 0.0), 0.3, rare_metal)
+ Sphere::new(Point3::new(1.0, -0.2, 0.0), 0.3, rare_metal)
);
world.push(
- Sphere::new(Point3::new(0.3, -0.4, 0.0), 0.4, glass.clone())
+ Sphere::new(Point3::new(0.3, -0.1, 0.0), 0.4, glass)
);