diff options
-rw-r--r-- | src/camera/camera.rs | 6 | ||||
-rw-r--r-- | src/core/bound.rs | 2 | ||||
-rw-r--r-- | src/main.rs | 2 | ||||
-rw-r--r-- | src/render/coordinator.rs | 3 |
4 files changed, 7 insertions, 6 deletions
diff --git a/src/camera/camera.rs b/src/camera/camera.rs index 241d26b..7f9e79d 100644 --- a/src/camera/camera.rs +++ b/src/camera/camera.rs @@ -8,6 +8,7 @@ //! ``` //! use rendering::camera::{CameraSettings, Camera}; //! use rendering::core::{Vector3f, Vector2f, Vector2i}; +//! use rendering::sample::UniformSampler; //! //! let set = CameraSettings { //! origin: Vector3f::new(10.0), @@ -16,12 +17,13 @@ //! fov: 90.0, //! filmsize: Vector2i::new(10), //! focus: None, -//! aperture: 0.0, +//! aperture: None, //! }; //! //! let cam = Camera::new(&set); +//! let mut sampler = UniformSampler::new(); //! -//! let (r, _) = cam.generate_ray(&Vector2f::new(5.0)); +//! let (r, _) = cam.generate_ray(&Vector2f::new(5.0), &mut sampler); //! let dir = r.direction; //! //! assert!( diff --git a/src/core/bound.rs b/src/core/bound.rs index 3978028..37918d4 100644 --- a/src/core/bound.rs +++ b/src/core/bound.rs @@ -128,7 +128,7 @@ mod tests { let b1 = Bound2i::new_xyxy(10, 10, 20, 20); let b2 = Bound2i::new_xyxy(2, 11, 22, 17); - let b = intersect(&b1, &b2); + let b = b1.intersect(&b2); assert!( b.min.x == 10 && diff --git a/src/main.rs b/src/main.rs index 0f6502e..07228a0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,7 @@ fn main() { { let coord = RenderCoord::new(&mut film, Vector2i::new_xy(32, 32), 300); - coord.run_threaded(&ctx, &mut sampler, 8); + coord.run_threaded(&ctx, &mut sampler, 4); } let image = film.finalize_image(); diff --git a/src/render/coordinator.rs b/src/render/coordinator.rs index a8d8afb..e2f825b 100644 --- a/src/render/coordinator.rs +++ b/src/render/coordinator.rs @@ -7,8 +7,7 @@ use crate::camera::Film; use crate::core::{Bound2i, Vector2i}; use crate::sample::Sampler; -use std::sync::{Arc, Mutex}; -use std::thread; +use std::sync::{Mutex}; struct Tiler { tilesize: Vector2i, |