From 33e747fa1c0957546c10e4d7b490ac7fbb0fd2d2 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 7 Feb 2021 14:25:06 +0100 Subject: Abstracted lambertian into material --- src/material/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/material/mod.rs (limited to 'src/material/mod.rs') diff --git a/src/material/mod.rs b/src/material/mod.rs new file mode 100644 index 0000000..62cbf9a --- /dev/null +++ b/src/material/mod.rs @@ -0,0 +1,10 @@ +use crate::core::{Ray, Intersection, Spectrum}; +use crate::sample::Sampler; + +mod lambertian; + +pub use lambertian::Lambertian; + +pub trait Material { + fn scatter(&self, ray: &Ray, i: &Intersection, sampler: &mut dyn Sampler) -> Option<(Spectrum, Ray)>; +} -- cgit v1.2.3