WIP: library: render: pathtracer: add build_path

This commit is contained in:
Bruno BELANYI 2020-03-30 02:23:12 +02:00
parent 6d0de72e57
commit 7eefd7b574

View file

@ -1,6 +1,9 @@
use super::super::Renderer; use super::super::Renderer;
use super::path::*;
use crate::scene::Scene; use crate::scene::Scene;
use crate::{Point, Vector};
use image::RgbImage; use image::RgbImage;
use nalgebra::Unit;
/// Render the [`Scene`] using Bidirectional-Pathtracing /// Render the [`Scene`] using Bidirectional-Pathtracing
/// ///
@ -25,6 +28,18 @@ impl Pathtracer {
pub fn render(&self) -> RgbImage { pub fn render(&self) -> RgbImage {
todo!() todo!()
} }
fn construct_path(&self, point: Point, direction: Unit<Vector>) -> 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 { impl Renderer for Pathtracer {