From b624ced37f89d498fa442aa381cf10ee86a347e8 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 30 Mar 2020 02:04:37 +0200 Subject: [PATCH] library: render: pathtrace: add dummy Pathtracer --- pathtracer/src/render/mod.rs | 3 ++ pathtracer/src/render/pathtrace/mod.rs | 2 ++ pathtracer/src/render/pathtrace/pathtracer.rs | 34 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 pathtracer/src/render/pathtrace/mod.rs create mode 100644 pathtracer/src/render/pathtrace/pathtracer.rs 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() + } +}