diff --git a/rtchallenge/src/intersections.rs b/rtchallenge/src/intersections.rs index 49cd5bd..ac24b2d 100644 --- a/rtchallenge/src/intersections.rs +++ b/rtchallenge/src/intersections.rs @@ -135,6 +135,7 @@ impl<'i> Index for Intersections<'i> { } } +#[derive(Debug)] pub struct PrecomputedData<'i> { pub t: f32, pub object: &'i Sphere, @@ -205,6 +206,7 @@ pub fn prepare_computations<'i>(i: &'i Intersection, r: &Ray) -> PrecomputedData } else { (false, normalv) }; + let over_point = point + normalv * EPSILON; PrecomputedData { t: i.t,