commit 767b5e44ecbd499734ed7d8172a61378ae4f93b5
parent cdb66bc4b7b153eb69176c15f65b90f43b2b2459
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 28 Jul 2017 09:51:11 +0200
Fix the per sampled instance estimated cos_factor
The per thread cos_factor estimation for each sampled instance was not
merged in the global per sampled instance cos_factor estimation leading
to null cos factors.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ssol_solver.c b/src/ssol_solver.c
@@ -598,6 +598,7 @@ accum_mc_sampled(struct mc_sampled* dst, struct mc_sampled* src)
dst->Name.weight += src->Name.weight; \
dst->Name.sqr_weight += src->Name.sqr_weight; \
} (void)0
+ ACCUM_WEIGHT(cos_factor);
ACCUM_WEIGHT(shadowed);
#undef ACCUM_WEIGHT
@@ -746,7 +747,7 @@ trace_radiative_path
view_samp, view_rt, ran_sun_dir, ran_sun_wl, thread_ctx->rng, &is_lit);
if(res != RES_OK) goto error;
-if(tracker) {
+ if(tracker) {
/* Add the first point of the starting segment */
if(tracker->sun_ray_length > 0) {
double pos[3], wi[3];