ft: 9: diffuse materials

This commit is contained in:
djaidjai committed 2026-04-15 15:18:33 +02:00
1 parent 5d18a57799
commit e8f84b590b
6 files changed
+332 -15

No files matched your search

+3 -1
View File
@@ -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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.