summaryrefslogtreecommitdiff
path: root/src/intersect.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/intersect.h')
-rw-r--r--src/intersect.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intersect.h b/src/intersect.h
index b1713d7..c400f1c 100644
--- a/src/intersect.h
+++ b/src/intersect.h
@@ -9,7 +9,7 @@
#include "matrix.h"
#include "rotate.h"
-#define EPSILON 1.0e-3f
+#define EPSILON 0.0f
/* Test the intersection between a ray starting from `origin` traveling in the
direction `direction` and a triangle defined by the vertices `v0`, `v1`, and
@@ -69,7 +69,7 @@ __device__ int get_color(const float3 &direction, const float3 &v0, const float3
unsigned int b = 0xFF & base_color;
if (scale < 0.0f)
- scale = dot(-normalize(cross(v1-v0,v2-v0)),-direction);
+ scale = dot(-normalize(cross(v1-v0,v2-v1)),-direction);
r = floorf(r*scale);
g = floorf(g*scale);