solstice-solver

Solver library of the solstice app
git clone git://git.meso-star.com/solstice-solver.git
Log | Files | Refs | README | LICENSE

commit c0fe180e4d62acf58512881058ba1c91c6afdb6e
parent 4451f9be1b62ce1d7791dd5f197a8393896fba86
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Tue, 13 Sep 2016 15:33:39 +0200

BugFix: dont' record on receivers when testing for sun visibility

(from a starting points)

Diffstat:
Msrc/ssol_scene.c | 3++-
Msrc/ssol_solver.c | 2++
Msrc/ssol_solver_c.h | 1+
3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/ssol_scene.c b/src/ssol_scene.c @@ -350,7 +350,8 @@ hit_filter_function } /* Check if the hit surface is a receiver that registers hit data */ - if (!str_is_empty(receiver_name)) { + /* sun segments must not be registered */ + if (!seg->sun_segment && !str_is_empty(receiver_name)) { fprintf(rs->data.out_stream, "Receiver '%s': %u %u %g %g (%g:%g:%g) (%g:%g:%g) (%g:%g)\n", str_cget(receiver_name), diff --git a/src/ssol_solver.c b/src/ssol_solver.c @@ -237,6 +237,7 @@ setup_next_segment(struct realisation* rs) reset_segment(seg); seg->self_instance = prev->hit_instance; seg->self_front = prev->hit_front; + seg->sun_segment = 0; d3_set(seg->org, prev->hit_pos); res = material_shade(prev->hit_material, &data->fragment, rs->freq, data->brdfs); @@ -495,6 +496,7 @@ receive_sunlight(struct realisation* rs) d3_set(seg->org, start->pos); seg->self_instance = start->instance; seg->self_front = start->front_exposed; + seg->sun_segment = 1; /* search for occlusions from starting point */ ASSERT(rs->s_idx == 0); /* sun segment */ diff --git a/src/ssol_solver_c.h b/src/ssol_solver_c.h @@ -69,6 +69,7 @@ struct segment { char hit_front; /* is the ending point of the segment on the front face? */ char self_front; /* was the starting point of the segment on the front face? */ char on_punched; /* is the hit on a punched shape? */ + char sun_segment; }; struct starting_point {