commit cbdf4cba353418749ed689a7b042a967fd29762f
parent 0665e1cfd154d306b9f480e2be14bc29e4171a3d
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Fri, 30 Sep 2016 11:12:51 +0200
Add an assert to catch a null direction problem on virtual material
Diffstat:
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/ssol_scene.c b/src/ssol_scene.c
@@ -296,6 +296,8 @@ scene_setup_s3d_sampling_scene
}
if(inst->dont_sample) continue;
+ /* FIXME: should not sample virtual (material) instance
+ as material is used to compute output dir */
hs = 1;
/* Attach the instantiated s3d sampling shape to the s3d sampling scene */
diff --git a/src/ssol_solver.c b/src/ssol_solver.c
@@ -311,6 +311,7 @@ setup_next_segment(struct realisation* rs)
seg->weight = prev->weight
* brdf_composite_sample(
data->brdfs, data->rng, prev->dir, data->fragment.Ns, seg->dir);
+ ASSERT(d3_dot(seg->dir, seg->dir));
if (rs->s_idx > 1) {
seg->weight *= compute_atmosphere_attenuation(
rs->data.scene->atmosphere, prev->hit_distance, rs->wavelength);