diff --git a/kernels/geometry/roundline_intersector.h b/kernels/geometry/roundline_intersector.h index a83dd72a7f..be6521a5cd 100644 --- a/kernels/geometry/roundline_intersector.h +++ b/kernels/geometry/roundline_intersector.h @@ -200,7 +200,7 @@ namespace embree { const Vec3vf p0p = p - p0; const vfloat y = dot(p0p,dP); - const vfloat cap0 = -r0dr+vfloat(ulp); + const vfloat cap0 = -r0dr+vfloat(ulp)*g; const vfloat cap1 = -r1*dr + dPdP; vbool inside_cone = valid_i & (p0.x != vfloat(inf)) & (p1.x != vfloat(inf)); @@ -335,11 +335,11 @@ namespace embree const vfloat rcp_2A = rcp(2.0f*A); t_cone_front = (-B-Q)*rcp_2A; y_cone_front = yp + t_cone_front*dOdP; - lower = select( (y_cone_front > -(float)ulp) & (y_cone_front <= g) & (g > 0.0f), t_cone_front, vfloat(pos_inf)); + lower = select( (y_cone_front > -(float)ulp*g) & (y_cone_front <= g) & (g > 0.0f), t_cone_front, vfloat(pos_inf)); #if !defined (EMBREE_BACKFACE_CULLING_CURVES) t_cone_back = (-B+Q)*rcp_2A; y_cone_back = yp + t_cone_back *dOdP; - upper = select( (y_cone_back > -(float)ulp) & (y_cone_back <= g) & (g > 0.0f), t_cone_back , vfloat(neg_inf)); + upper = select( (y_cone_back > -(float)ulp*g) & (y_cone_back <= g) & (g > 0.0f), t_cone_back , vfloat(neg_inf)); #endif return true; }