summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorAnthony LaTorre <telatorre@gmail.com>2011-05-09 13:58:12 -0400
committerAnthony LaTorre <telatorre@gmail.com>2011-05-09 13:58:12 -0400
commit7e61bfbe7df445ff43abfc802df9471cf66b55ca (patch)
treebe4dc6797a87b64db60c4d9d53c9e63e62e7145c /test.py
parentbcaef46bb56feb2f92c4feae1bff9e041a4f84cf (diff)
downloadchroma-7e61bfbe7df445ff43abfc802df9471cf66b55ca.tar.gz
chroma-7e61bfbe7df445ff43abfc802df9471cf66b55ca.tar.bz2
chroma-7e61bfbe7df445ff43abfc802df9471cf66b55ca.zip
improve triangle intersection algorithm by allowing it to terminate early
Diffstat (limited to 'test.py')
-rw-r--r--test.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/test.py b/test.py
index 5c7c234..ec7c954 100644
--- a/test.py
+++ b/test.py
@@ -17,17 +17,6 @@ def array2float3(arr):
return x
-def array2float4(arr):
- if len(arr.shape) != 2 or arr.shape[-1] != 3:
- raise Exception('shape mismatch')
-
- x = np.empty(arr.shape[0], dtype=gpuarray.vec.float4)
- x['x'] = arr[:,0]
- x['y'] = arr[:,1]
- x['z'] = arr[:,2]
-
- return x
-
print 'device %s' % autoinit.device.name()
source = open('src/linalg.h').read() + open('src/matrix.h').read() + \
@@ -77,9 +66,9 @@ translate(np.int32(mesh.size), mesh_gpu, gpuarray.vec.make_float3(0,30,0), block
for i in range(100):
- rotate(np.int32(x.size), x_gpu, np.float32(np.pi/50), gpuarray.vec.make_float3(0,0,1), block=(256,1,1), grid=(width*height//256+1,1))
+ rotate(np.int32(x.size), x_gpu, np.float32(np.pi/100), gpuarray.vec.make_float3(0,0,1), block=(256,1,1), grid=(width*height//256+1,1))
- rotate(np.int32(p.size), p_gpu, np.float32(np.pi/50), gpuarray.vec.make_float3(0,0,1), block=(256,1,1), grid=(width*height//256+1,1))
+ rotate(np.int32(p.size), p_gpu, np.float32(np.pi/100), gpuarray.vec.make_float3(0,0,1), block=(256,1,1), grid=(width*height//256+1,1))
t0 = time.time()
intersect(np.int32(x.size), x_gpu, p_gpu, np.int32(mesh.size//3), mesh_gpu, pixel_gpu, block=(256,1,1), grid=(width*height//256+1,1))