From b64c7e972c52b7d015d661866f0cf902370343e5 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sat, 6 Feb 2021 23:43:06 +0100 Subject: Implement pathtracing --- src/render.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/render.rs') 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)); } } -- cgit v1.2.3