commit b29061a77c0f6dd50737d2aee9bc47d093aa5d0c
parent 9505b19bbd54892343ce5e011ab3d77bbab723eb
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 19 Mar 2019 15:07:31 +0100
Still fix the russian roulette on surface scattering
The russian roulette always stoped the random walk on medium scattering
while it had to be simply disabled in this case.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/htrdr_compute_radiance_sw.c b/src/htrdr_compute_radiance_sw.c
@@ -325,7 +325,7 @@ htrdr_compute_radiance_sw
/* Radiative random walk */
for(;;) {
struct scattering_context scattering_ctx = SCATTERING_CONTEXT_NULL;
- double bounce_reflectivity = 0;
+ double bounce_reflectivity = 1;
/* Find the first intersection with a surface */
d2(range, 0, DBL_MAX);
@@ -431,8 +431,9 @@ htrdr_compute_radiance_sw
ksi *= Tr_abs;
w += ksi * L_sun * sun_solid_angle * Tr * R;
- /* Russian roulette */
- if(ssp_rng_canonical(rng) >= bounce_reflectivity) break;
+ /* Russian roulette wrt surface scattering */
+ if(SVX_HIT_NONE(&svx_hit) && ssp_rng_canonical(rng) >= bounce_reflectivity)
+ break;
/* Setup the next random walk state */
d3_set(pos, pos_next);