Feat: Rudimentary dielectric... but broken

Dielectric material matching Raytracing in a Weekend book chapter 10.2.
But it isn't right. The spheres turn into solid black holes.

As I'm making the commit, I've found the problem. I'm separating it out
so I can tag it and explore the code a bit more. See the step-by-step
changes, and such.
This commit is contained in:
2023-06-06 17:39:09 -05:00
parent ef5e3fa388
commit 4ea2208208
3 changed files with 43 additions and 20 deletions

View File

@@ -34,8 +34,8 @@ fn main() {
// world
let mat_ground = Material::Lambertian{ albedo: Vec3::new(0.8, 0.8, 0.0) };
let mat_center = Material::Lambertian{ albedo: Vec3::new(0.7, 0.3, 0.3) };
let mat_left = Material::Metal{ albedo: Vec3::new(0.8, 0.8, 0.8), fuzz: 0.3 };
let mat_center = Material::Dielectric { index_refraction: 1.5 };
let mat_left = Material::Dielectric { index_refraction: 1.5 };
let mat_right = Material::Metal{ albedo: Vec3::new(0.8, 0.6, 0.2), fuzz: 1.0 };
let mut world = HittableList::new();