diff options
| author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-07-30 16:10:27 -0400 |
|---|---|---|
| committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-07-30 16:10:27 -0400 |
| commit | 1a6dc30108d3e78f72f773ec025fc98e246f68f5 (patch) | |
| tree | de7603aaca9912521bd1ea2cc7291e7681e09bb1 /src/photon.h | |
| parent | 368524c5007a1f6ce2ef7be8d5dc1156c41a9dc2 (diff) | |
| download | chroma-1a6dc30108d3e78f72f773ec025fc98e246f68f5.tar.gz chroma-1a6dc30108d3e78f72f773ec025fc98e246f68f5.tar.bz2 chroma-1a6dc30108d3e78f72f773ec025fc98e246f68f5.zip | |
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.
Diffstat (limited to 'src/photon.h')
| -rw-r--r-- | src/photon.h | 8 |
1 files changed, 2 insertions, 6 deletions
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) |
