summaryrefslogtreecommitdiff
path: root/chroma
diff options
context:
space:
mode:
authorAndy Mastbaum <mastbaum@hep.upenn.edu>2012-05-02 11:05:52 -0400
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:39 -0700
commitef5645baef14b53ed8ca3d72941c364ef5586e50 (patch)
tree72b27fbe8b8bbddfd4a99131c5cedfc121f63a2b /chroma
parent8a4a94466930205826c638a69a3501b6aecd5006 (diff)
downloadchroma-ef5645baef14b53ed8ca3d72941c364ef5586e50.tar.gz
chroma-ef5645baef14b53ed8ca3d72941c364ef5586e50.tar.bz2
chroma-ef5645baef14b53ed8ca3d72941c364ef5586e50.zip
make bulk reemission isotropic
Diffstat (limited to 'chroma')
-rw-r--r--chroma/cuda/photon.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/chroma/cuda/photon.h b/chroma/cuda/photon.h
index cb1c092..0beaec4 100644
--- a/chroma/cuda/photon.h
+++ b/chroma/cuda/photon.h
@@ -240,9 +240,12 @@ int propagate_to_boundary(Photon &p, State &s, curandState &rng,
s.material1->wavelength0,
s.material1->step,
s.material1->reemission_cdf);
+ p.direction = uniform_sphere(&rng);
+ p.polarization = cross(uniform_sphere(&rng), p.direction);
+ p.polarization /= norm(p.polarization);
p.history |= BULK_REEMIT;
return CONTINUE;
- } // photon is reemitted
+ } // photon is reemitted isotropically
else {
p.last_hit_triangle = -1;
p.history |= BULK_ABSORB;