commit bf386fec2bd9fe2c42621cc7a8470d917050989f
parent f8c8ab4e120f5eb35c26a5167f1f9983ead96484
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 28 Feb 2017 15:32:14 +0100
Fix a precision issue in the RT of the punched surface
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/ssol_scene.c b/src/ssol_scene.c
@@ -395,6 +395,8 @@ hit_filter_function
/* No ray data => nothing to filter */
if(!ray_data) return 0;
+ /* Handle numerical imprecision */
+ if(hit->distance <= rdata->range_min) return 1;
/* Retrieve the intersected instance and shaded shape */
inst = *htable_instance_find(&rdata->scn->instances_rt, &hit->prim.inst_id);
@@ -425,7 +427,7 @@ hit_filter_function
/* No projection is found => the ray does not intersect the quadric */
return 1;
}
- if(dst <= rdata->range_min) {
+ if((float)dst <= rdata->range_min) {
/* Handle RT numerical imprecision, the hit is below the lower bound
* of the ray range. */
return 1;