From 1a6dc30108d3e78f72f773ec025fc98e246f68f5 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Sat, 30 Jul 2011 16:10:27 -0400 Subject: when throwing photons from the light source out onto the scene, photons are now thrown randomly across each triangle instead of only at the center of each triangle. all of the rendering kernels have been rewritten so that they operate additively; for example, you may now throw photons from the light source onto the scene, render from the camera to the scene, then throw more photons and render again. --- src/photon.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/photon.h') diff --git a/src/photon.h b/src/photon.h index ad4c26c..f471866 100644 --- a/src/photon.h +++ b/src/photon.h @@ -19,8 +19,6 @@ struct Photon unsigned int history; int last_hit_triangle; - - //curandState rng; }; struct State @@ -51,14 +49,14 @@ enum enum {BREAK, CONTINUE, PASS}; // return value from propagate_to_boundary -__device__ int fill_state(State &s, Photon &p, curandState &rng) +__device__ void fill_state(State &s, Photon &p) { p.last_hit_triangle = intersect_mesh(p.position, p.direction, s.distance_to_boundary, p.last_hit_triangle); if (p.last_hit_triangle == -1) { p.history |= NO_HIT; - return BREAK; + return; } uint4 triangle_data = g_triangles[p.last_hit_triangle]; @@ -98,8 +96,6 @@ __device__ int fill_state(State &s, Photon &p, curandState &rng) s.absorption_length = interp_property(p.wavelength, material1.absorption_length); s.scattering_length = interp_property(p.wavelength, material1.scattering_length); - return PASS; - } // fill_state __device__ void rayleigh_scatter(Photon &p, curandState &rng) -- cgit