summaryrefslogtreecommitdiff
path: root/src/intersect.h
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-07-25 16:41:34 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-07-25 16:41:34 -0400
commit0716c8af5be04ea1709ca178d5341e5ee3df607b (patch)
tree83e124c4f0ea59a8fdf022cdecc22a4a4d76fe09 /src/intersect.h
parent90372f3f5cd2ba25e6b24fe2b229275265c98e81 (diff)
downloadchroma-0716c8af5be04ea1709ca178d5341e5ee3df607b.tar.gz
chroma-0716c8af5be04ea1709ca178d5341e5ee3df607b.tar.bz2
chroma-0716c8af5be04ea1709ca178d5341e5ee3df607b.zip
moved triangle colors to a separate global device array so that the ray tracer and photon simulation can be run in the same context. added the ability to add alpha channel to triangle color so that triangles can be made transparent. added __noinline__ modifier to certain device functions to speed up kernel compilation.
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);