diff options
| author | Andy Mastbaum <mastbaum@hep.upenn.edu> | 2012-05-02 11:05:52 -0400 |
|---|---|---|
| committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:39 -0700 |
| commit | ef5645baef14b53ed8ca3d72941c364ef5586e50 (patch) | |
| tree | 72b27fbe8b8bbddfd4a99131c5cedfc121f63a2b /chroma | |
| parent | 8a4a94466930205826c638a69a3501b6aecd5006 (diff) | |
| download | chroma-ef5645baef14b53ed8ca3d72941c364ef5586e50.tar.gz chroma-ef5645baef14b53ed8ca3d72941c364ef5586e50.tar.bz2 chroma-ef5645baef14b53ed8ca3d72941c364ef5586e50.zip | |
make bulk reemission isotropic
Diffstat (limited to 'chroma')
| -rw-r--r-- | chroma/cuda/photon.h | 5 |
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; |
