diff options
author | Julian T <julian@jtle.dk> | 2021-02-05 20:17:20 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-05 20:17:20 +0100 |
commit | 1e83ea211055eb234b89c69b5d03602e3fcb98fb (patch) | |
tree | 7b58c7e6d7d174906541e9f2acf546294f8e9ca5 /src/main.rs | |
parent | 9235e74dfbc41895a5f8807e1ab93508268a39ea (diff) |
Achieve anti aliasing with multi pixel sampling
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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); |