From 46011a8e4ffa31f4b057b20b84e5b45b447902b7 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Wed, 20 Jul 2011 17:48:32 -0400 Subject: pulled a lot of the photon propagation code out of src/kernel.cu into src/photon.h so that photon propagation by propagate() in kernel.cu and the hybrid monte carlo ray tracing use the same code. instead of a single state, photons now carry the history of the processes they've undergone. this history is stored as a bitmask; see src/photon.h. start_node and first_node of the mesh are now stored as global variables in mesh.h instead of being passed to kernel functions. --- render.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'render.py') diff --git a/render.py b/render.py index 3ba0276..fe70492 100755 --- a/render.py +++ b/render.py @@ -50,10 +50,10 @@ def render(viewable, size=(800,600), name='', bits=8, make_movie=False): rgb_lookup_gpu = gpuarray.zeros(source_positions_gpu.size, dtype=gpuarray.vec.float3) max_steps = 10 - rgb_runs = 100 + rgb_runs = 1000 print 'building rgb lookup.' - cuda_build_rgb_lookup(np.int32(source_positions_gpu.size), rng_states_gpu, source_positions_gpu, source_directions_gpu, np.int32(geometry.node_map.size-1), np.int32(geometry.first_node), rgb_lookup_gpu, np.int32(rgb_runs), np.int32(max_steps), block=(64,1,1), grid=(source_positions_gpu.size//64+1,1)) + cuda_build_rgb_lookup(np.int32(source_positions_gpu.size), rng_states_gpu, source_positions_gpu, source_directions_gpu, rgb_lookup_gpu, np.int32(rgb_runs), np.int32(max_steps), block=(64,1,1), grid=(source_positions_gpu.size//64+1,1)) cuda.Context.synchronize() print 'done.' @@ -97,7 +97,7 @@ def render(viewable, size=(800,600), name='', bits=8, make_movie=False): global image_index t0 = time.time() - cuda_render(np.int32(pixels_gpu.size), rng_states_gpu, origins_gpu, directions_gpu, np.int32(geometry.node_map.size-1), np.int32(geometry.first_node), rgb_lookup_gpu, np.int32(nruns), pixels_gpu, np.int32(max_steps), block=(nblocks,1,1), grid=(pixels_gpu.size//nblocks+1,1)) + cuda_render(np.int32(pixels_gpu.size), rng_states_gpu, origins_gpu, directions_gpu, rgb_lookup_gpu, np.int32(nruns), pixels_gpu, np.int32(max_steps), block=(nblocks,1,1), grid=(pixels_gpu.size//nblocks+1,1)) cuda.Context.synchronize() elapsed = time.time() - t0 -- cgit