aboutsummaryrefslogtreecommitdiff
path: root/src/trace/pathtrace.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-08 14:32:11 +0100
committerJulian T <julian@jtle.dk>2021-02-08 14:32:11 +0100
commitdbe5f54957ddc13549a6ce822da95170aa09a0c6 (patch)
tree7cc45f25dd75cb7893fd0af49ae5353e38c5e392 /src/trace/pathtrace.rs
parent6df0417568ef6f315138d9c3fd707ac3241a6a30 (diff)
Rename to pathtrace, started for of depth of field, choose closest intersect
Diffstat (limited to 'src/trace/pathtrace.rs')
-rw-r--r--src/trace/pathtrace.rs4
1 files changed, 2 insertions, 2 deletions
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;