diff options
Diffstat (limited to 'src/trace')
-rw-r--r-- | src/trace/mod.rs | 4 | ||||
-rw-r--r-- | src/trace/pathtrace.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/trace/mod.rs b/src/trace/mod.rs index cf06246..6c2c9f3 100644 --- a/src/trace/mod.rs +++ b/src/trace/mod.rs @@ -30,8 +30,8 @@ impl NormTracer<'_> { impl Tracer for NormTracer<'_> { fn trace(&self, _: &mut dyn Sampler, ray: &Ray) -> Spectrum { // Trace ray, we dont care about material - if let Some((_, i)) = self.scn.intersect(ray) { - let norm = i.n * 0.5 + Vector3f::new(0.5); + if let Some(si) = self.scn.intersect(ray) { + let norm = si.i.n * 0.5 + Vector3f::new(0.5); return Spectrum::new_rgb(norm.x, norm.y, norm.z); } diff --git a/src/trace/pathtrace.rs b/src/trace/pathtrace.rs index 811b653..af24118 100644 --- a/src/trace/pathtrace.rs +++ b/src/trace/pathtrace.rs @@ -24,8 +24,8 @@ impl PathTracer<'_> { return Spectrum::ZERO; } - if let Some((mat, i)) = self.scn.intersect(ray) { - if let Some((scalar, nray)) = mat.scatter(ray, &i, sampler) { + if let Some(si) = self.scn.intersect(ray) { + if let Some((scalar, nray)) = si.mat.scatter(ray, &si.i, sampler) { return self.trace_recur(sampler, &nray, depth-1) * scalar; } else { return Spectrum::ZERO; |