From dbe5f54957ddc13549a6ce822da95170aa09a0c6 Mon Sep 17 00:00:00 2001 From: Julian T Date: Mon, 8 Feb 2021 14:32:11 +0100 Subject: Rename to pathtrace, started for of depth of field, choose closest intersect --- src/main.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/main.rs') 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); -- cgit v1.2.3