diff options
author | Julian T <julian@jtle.dk> | 2021-02-08 14:32:11 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-08 14:32:11 +0100 |
commit | dbe5f54957ddc13549a6ce822da95170aa09a0c6 (patch) | |
tree | 7cc45f25dd75cb7893fd0af49ae5353e38c5e392 /src/main.rs | |
parent | 6df0417568ef6f315138d9c3fd707ac3241a6a30 (diff) |
Rename to pathtrace, started for of depth of field, choose closest intersect
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs index ac197a1..1707360 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,11 @@ -use pathtrace::camera::{Camera, Film, CameraSettings}; -use pathtrace::scene::{Scene, Object}; -use pathtrace::trace::DefaultTracer; -use pathtrace::scene::shapes::Sphere; -use pathtrace::core::{Vector2i, Vector3f, Spectrum}; -use pathtrace::render::{RenderContext, RenderTask}; -use pathtrace::sample::UniformSampler; -use pathtrace::material::{Reflectant, Lambertian}; +use rendering::camera::{Camera, Film, CameraSettings}; +use rendering::scene::{Scene, Object}; +use rendering::trace::DefaultTracer; +use rendering::scene::shapes::Sphere; +use rendering::core::{Vector2i, Vector3f, Spectrum}; +use rendering::render::{RenderContext, RenderTask}; +use rendering::sample::UniformSampler; +use rendering::material::{Reflectant, Lambertian}; use std::rc::Rc; @@ -14,10 +14,12 @@ fn main() { let cam = Camera::new(&CameraSettings { target: Vector3f::new_xyz(0.5, 0.0, -1.0), - origin: Vector3f::new_xyz(0.0, 0.0, 0.5), + origin: Vector3f::new_xyz(1.7, 0.0, 0.0), up: Vector3f::new_xyz(0.0, 1.0, 0.0), fov: 90.0, - screensize: res, + filmsize: res, + focus: None, + aperture: 0.5, }); let brown = Rc::new(Lambertian::new(Spectrum::new_rgb(0.5, 0.3, 0.0))); @@ -40,7 +42,7 @@ fn main() { let mut film = Film::new(res); let tile = film.get_tile(&film.frame); - let mut task = RenderTask::new(Box::new(tile), 100); + let mut task = RenderTask::new(Box::new(tile), 10); task.render(&ctx, &mut sampler); film.commit_tile(&task.tile); |