ft: 9: diffuse materials
This commit is contained in:
@@ -28,7 +28,9 @@ impl Hit {
|
||||
for hittable in hittables {
|
||||
if let Some(hit) = hittable.hit(r) {
|
||||
// hit happens in front of camera and is closer than closest
|
||||
if *hit.t() > 0. && (closest.is_none() || closest.as_ref().unwrap().t() > hit.t()) {
|
||||
if *hit.t() > 0.001
|
||||
&& (closest.is_none() || closest.as_ref().unwrap().t() > hit.t())
|
||||
{
|
||||
closest = Some(hit);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user