diff --git a/pathtracer/src/render/mod.rs b/pathtracer/src/render/mod.rs index 89cde0c..2da13a2 100644 --- a/pathtracer/src/render/mod.rs +++ b/pathtracer/src/render/mod.rs @@ -9,6 +9,9 @@ pub trait Renderer { fn render(&self) -> RgbImage; } +mod pathtrace; +pub use pathtrace::*; + mod raytracer; pub use raytracer::*; diff --git a/pathtracer/src/render/pathtrace/mod.rs b/pathtracer/src/render/pathtrace/mod.rs new file mode 100644 index 0000000..dd2cbdd --- /dev/null +++ b/pathtracer/src/render/pathtrace/mod.rs @@ -0,0 +1,2 @@ +mod pathtracer; +pub use self::pathtracer::*; diff --git a/pathtracer/src/render/pathtrace/pathtracer.rs b/pathtracer/src/render/pathtrace/pathtracer.rs new file mode 100644 index 0000000..bba0c76 --- /dev/null +++ b/pathtracer/src/render/pathtrace/pathtracer.rs @@ -0,0 +1,34 @@ +use super::super::Renderer; +use crate::scene::Scene; +use image::RgbImage; + +/// Render the [`Scene`] using Bidirectional-Pathtracing +/// +/// [`Scene`]: ../scene/scene/struct.Scene.html +pub struct Pathtracer { + #[allow(unused)] + scene: Scene, +} + +impl Pathtracer { + /// Create a [`Pathtracer`] renderer with the given [`Scene`] + /// + /// [`Pathtracer`]: struct.Pathtracer.html + /// [`Scene`]: ../scene/scene/struct.Scene.html + pub fn new(scene: Scene) -> Self { + Pathtracer { scene } + } + + /// Render the [`Scene`] using Bidirectional-Pathtracing. + /// + /// [`Scene`]: ../scene/scene/struct.Scene.html + pub fn render(&self) -> RgbImage { + todo!() + } +} + +impl Renderer for Pathtracer { + fn render(&self) -> RgbImage { + self.render() + } +}