aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-05 20:17:20 +0100
committerJulian T <julian@jtle.dk>2021-02-05 20:17:20 +0100
commit1e83ea211055eb234b89c69b5d03602e3fcb98fb (patch)
tree7b58c7e6d7d174906541e9f2acf546294f8e9ca5 /src/main.rs
parent9235e74dfbc41895a5f8807e1ab93508268a39ea (diff)
Achieve anti aliasing with multi pixel sampling
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
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);