We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a556340 commit f015eefCopy full SHA for f015eef
src/shapes/triangle.rs
@@ -335,6 +335,9 @@ impl Triangle {
335
// override surface normal in _isect_ for triangle
336
let mut surface_normal: Normal3f =
337
Normal3f::from(vec3_cross_vec3(&dp02, &dp12).normalize());
338
+ if self.mesh.reverse_orientation ^ self.mesh.transform_swaps_handedness {
339
+ surface_normal = -surface_normal;
340
+ }
341
let mut shading: Shading = Shading {
342
n: surface_normal,
343
dpdu,
0 commit comments