From 7eefd7b57477075c4e8bb7caadef6142f7376e6a Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 30 Mar 2020 02:23:12 +0200 Subject: [PATCH] WIP: library: render: pathtracer: add build_path --- pathtracer/src/render/pathtrace/pathtracer.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pathtracer/src/render/pathtrace/pathtracer.rs b/pathtracer/src/render/pathtrace/pathtracer.rs index bba0c76..6d113ab 100644 --- a/pathtracer/src/render/pathtrace/pathtracer.rs +++ b/pathtracer/src/render/pathtrace/pathtracer.rs @@ -1,6 +1,9 @@ use super::super::Renderer; +use super::path::*; use crate::scene::Scene; +use crate::{Point, Vector}; use image::RgbImage; +use nalgebra::Unit; /// Render the [`Scene`] using Bidirectional-Pathtracing /// @@ -25,6 +28,18 @@ impl Pathtracer { pub fn render(&self) -> RgbImage { todo!() } + + fn construct_path(&self, point: Point, direction: Unit) -> Path { + let mut res = Path::new(point); + for _ in 0..self.scene.reflection_limit { + // FIXME: + // * cast_ray: if no intersection, return the empty path + // * look-up information at intersection + // * append to path + // * start again with new origin + } + res + } } impl Renderer for Pathtracer {