ft: normal mapping

This commit is contained in:
djaidjai committed 2026-05-02 13:58:46 +02:00
1 parent ae73e626b9
commit bf980a28ec
6 files changed
+14 -12

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@ impl Dielectric {
}
impl Material for Dielectric {
fn scatter(&self, hit: &Hit, ray: &Ray) -> Option<(Ray, Colour)> {
fn scatter(&self, hit: &Hit, ray: &Ray) -> Option<(Option<Ray>, Colour)> {
let ri = if hit.front_face() {
1. / self.refraction_index
} else {
@@ -51,6 +51,6 @@ impl Material for Dielectric {
} else {
unit.refract(hit.n(), ri)
};
Some((Ray::new(*hit.p(), dir), Colour::new(1., 1., 1.)))
Some((Some(Ray::new(*hit.p(), dir)), Colour::new(1., 1., 1.)))
}
}
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.