From 1e83ea211055eb234b89c69b5d03602e3fcb98fb Mon Sep 17 00:00:00 2001 From: Julian T Date: Fri, 5 Feb 2021 20:17:20 +0100 Subject: Achieve anti aliasing with multi pixel sampling --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 9985a80..c1383ad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use pathtrace::trace::Tracer; use pathtrace::scene::shapes::Sphere; use pathtrace::core::{Vector2i, Vector3f}; use pathtrace::render::{RenderContext, RenderTask}; +use pathtrace::sample::UniformSampler; fn main() { let res = Vector2i::new_xy(500, 500); @@ -22,13 +23,15 @@ fn main() { let tracer = Tracer::new(); + let mut sampler = UniformSampler::new(); + let ctx = RenderContext { cam: &cam, scn: &scn, trc: &tracer }; let mut film = Film::new(res); let tile = film.get_tile(&film.frame); - let mut task = RenderTask::new(Box::new(tile), 1); - task.render(&ctx); + let mut task = RenderTask::new(Box::new(tile), 500); + task.render(&ctx, &mut sampler); film.commit_tile(&task.tile); -- cgit v1.2.3