rtiow: add simple debugging material.

This commit is contained in:
Bill Thiede 2023-02-02 16:57:33 -08:00
parent f7c5f29e67
commit 188b550fb7

View File

@ -251,6 +251,20 @@ where
}
}
#[derive(Debug)]
pub struct DebugMaterial {}
impl Material for DebugMaterial {
fn scatter(&self, _r_in: &Ray, rec: &HitRecord) -> ScatterResponse {
let dir = Vec3::new(0., -1., -1.).unit_vector();
ScatterResponse {
scattered: Ray::new(rec.p, dir, 0.),
attenutation: [1., 1., 1.].into(),
reflected: true,
}
}
}
#[cfg(test)]
mod tests {
use super::*;