aboutsummaryrefslogtreecommitdiff
path: root/src/trace
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-06 17:27:42 +0100
committerJulian T <julian@jtle.dk>2021-02-06 17:27:42 +0100
commit0d5e6bd9363d5ed5c4f28174819fc0f5fd9aa586 (patch)
treef9ecafe7350ad616486e509ed55904295f505f83 /src/trace
parent1e83ea211055eb234b89c69b5d03602e3fcb98fb (diff)
Reorganized scene module, and fixed bug in sphere intersect
Diffstat (limited to 'src/trace')
-rw-r--r--src/trace/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/trace/mod.rs b/src/trace/mod.rs
index 90f12da..9c8b0b8 100644
--- a/src/trace/mod.rs
+++ b/src/trace/mod.rs
@@ -19,8 +19,7 @@ impl NormTracer {
pub fn trace(&self, scn: &Scene, ray: &Ray) -> Spectrum {
// Trace ray
if let Some(i) = scn.intersect(ray) {
- let p = ray.at(i.t);
- let norm = i.shp.norm_at(&p) * 0.5 + Vector3f::new(0.5);
+ let norm = i.n * 0.5 + Vector3f::new(0.5);
return Spectrum::new_rgb(norm.x, norm.y, norm.z);
}