diff options
author | Julian T <julian@jtle.dk> | 2021-02-06 17:27:42 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-06 17:27:42 +0100 |
commit | 0d5e6bd9363d5ed5c4f28174819fc0f5fd9aa586 (patch) | |
tree | f9ecafe7350ad616486e509ed55904295f505f83 /src/trace | |
parent | 1e83ea211055eb234b89c69b5d03602e3fcb98fb (diff) |
Reorganized scene module, and fixed bug in sphere intersect
Diffstat (limited to 'src/trace')
-rw-r--r-- | src/trace/mod.rs | 3 |
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); } |