rtiow: add simple debugging material.
This commit is contained in:
parent
f7c5f29e67
commit
188b550fb7
@ -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)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user