aboutsummaryrefslogtreecommitdiff
path: root/src/render.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-06 23:43:06 +0100
committerJulian T <julian@jtle.dk>2021-02-06 23:43:06 +0100
commitb64c7e972c52b7d015d661866f0cf902370343e5 (patch)
tree8d3dc9a8ae6b491b9f8f639f2d0bad6387d59069 /src/render.rs
parent0d5e6bd9363d5ed5c4f28174819fc0f5fd9aa586 (diff)
Implement pathtracing
Diffstat (limited to 'src/render.rs')
-rw-r--r--src/render.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/render.rs b/src/render.rs
index 9c9e924..23b80ae 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -3,11 +3,10 @@
//! This is not a final design
use crate::camera::film::FilmTile;
use crate::camera::Camera;
-use crate::scene::Scene;
-use crate::trace::Tracer;
+use crate::trace::{DefaultTracer, Tracer};
use crate::sample::Sampler;
-use crate::core::{Vector2f, Spectrum};
+use crate::core::{Vector2f};
use crate::Float;
pub struct RenderTask {
@@ -16,9 +15,8 @@ pub struct RenderTask {
}
pub struct RenderContext<'a> {
- pub scn: &'a Scene,
pub cam: &'a Camera,
- pub trc: &'a Tracer,
+ pub trc: &'a DefaultTracer<'a>,
}
impl RenderTask {
@@ -35,7 +33,7 @@ impl RenderTask {
// Create a ray
let (r, _) = ctx.cam.generate_ray(&p);
- self.tile.add_sample(&p, ctx.trc.trace(ctx.scn, &r));
+ self.tile.add_sample(&p, ctx.trc.trace(sampler, &r));
}
}