Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r984 - in trunk/Model: Materials Primitives
- Date: Sun, 12 Mar 2006 22:14:54 -0700 (MST)
Author: boulos
Date: Sun Mar 12 22:14:53 2006
New Revision: 984
Modified:
trunk/Model/Materials/NDotL.cc
trunk/Model/Primitives/WaldTriangle.cc
Log:
Changing NDotL to always just return the color
for now (the cosine value seems to be wrong...)
WaldTriangle has been tested for C, SSE, and Altivec.
Switching between versions is controlled by some #defines
at the top of the file for now, but can be changed later to
something more elegant.
Modified: trunk/Model/Materials/NDotL.cc
==============================================================================
--- trunk/Model/Materials/NDotL.cc (original)
+++ trunk/Model/Materials/NDotL.cc Sun Mar 12 22:14:53 2006
@@ -77,6 +77,7 @@
direction);
if (cosine < 0)
cosine = 0;
- rays.setColor( i, colors[i] * cosine );
+ //rays.setColor( i, colors[i] * cosine );
+ rays.setColor(i, colors[i]);
}
}
Modified: trunk/Model/Primitives/WaldTriangle.cc
==============================================================================
--- trunk/Model/Primitives/WaldTriangle.cc (original)
+++ trunk/Model/Primitives/WaldTriangle.cc Sun Mar 12 22:14:53 2006
@@ -8,6 +8,10 @@
using namespace Manta;
using namespace std;
+#define USE_SIMD 0
+#define USE_ALTIVEC 1
+#define USE_SSE 0
+
WaldTriangle::WaldTriangle(Material* mat,
const Vector& _p1, const Vector& _p2, const
Vector& _p3) : PrimitiveCommon(mat)
{
@@ -63,7 +67,7 @@
n_k = normal[k];
}
-#if 1 // portable C version
+#if !(USE_SIMD) // portable C version
void WaldTriangle::intersect(const RenderContext& context, RayPacket& rays)
const
{
const int axis = k;
@@ -127,7 +131,7 @@
// SSE version
#include <float.h>
-#if 1 // altivec
+#if USE_ALTIVEC // altivec
typedef vector float sse_t;
typedef vector bool sse_mask_t;
@@ -174,7 +178,10 @@
#define cmp_lte4 vec_cmple
-#else
+#endif
+
+
+#if USE_SSE
#include <xmmintrin.h>
@@ -278,7 +285,7 @@
const int ray_begin = rays.begin();
const int ray_end = rays.end();
- const bool RaysConstantOrigin = rays.getAllFlags() &
RayPacket::ConstantOrigin;
+ const bool RaysConstantOrigin = false;//rays.getAllFlags() &
RayPacket::ConstantOrigin;
for ( int ray = sse_begin * 4; ray < ray_begin; ray++ )
{
- [MANTA] r984 - in trunk/Model: Materials Primitives, boulos, 03/12/2006
Archive powered by MHonArc 2.6.16.