wip: normal material

This commit is contained in:
2026-05-02 13:48:27 +02:00
parent c3d37f4758
commit ae73e626b9
10 changed files with 36 additions and 12 deletions

View File

@@ -1,5 +1,3 @@
use log::{info, warn};
use crate::objects::hit::Hit;
use crate::objects::traits::Hittable;
use crate::ray::Ray;
@@ -56,7 +54,7 @@ impl Triangle {
let diff = (a4 - a1 - a2 - a3).abs();
if diff < 0.001 {
return Some(Hit::new(t, p, normal, material, normal.dot(&-r.dir()) < 0.));
return Some(Hit::new(t, p, normal, material, normal.dot(&-r.dir()) > 0.));
} else {
return None;
}