htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit bd9a4f3b36054a97fc6831747cf590d55af67aa9
parent 2692cc078b1b35b1f22f1587f6ee903fdd9f1a41
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 19 Mar 2019 15:11:45 +0100

Merge branch 'hotfix_0.0.4' into develop

Diffstat:
Msrc/htrdr_compute_radiance_sw.c | 7++++---
Msrc/htrdr_sky.c | 2+-
2 files changed, 5 insertions(+), 4 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); diff --git a/src/htrdr_sky.c b/src/htrdr_sky.c @@ -1488,7 +1488,7 @@ setup_atmosphere vox_desc.challenge_merge = atmosphere_vox_challenge_merge; vox_desc.context = &ctx; vox_desc.size = sizeof(float) * NFLOATS_PER_COMPONENT; - STATIC_ASSERT(HTRDR_GAS__ == 0, Unexpected_enum_value); + { STATIC_ASSERT(HTRDR_GAS__ == 0, Unexpected_enum_value); } /* Create as many atmospheric data structure than considered SW spectral * bands */