From 8fca3727f4eb308d2ec235af84331942f50fff75 Mon Sep 17 00:00:00 2001 From: "Gregory J. Ward" Date: Mon, 11 Nov 2024 19:01:55 +0000 Subject: [PATCH] fix(rpict,rtrace,rvu,rcontrib): Went back to previous behind test --- src/rt/ambient.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/rt/ambient.c b/src/rt/ambient.c index 19246047..c9c01002 100644 --- a/src/rt/ambient.c +++ b/src/rt/ambient.c @@ -1,4 +1,4 @@ -static const char RCSid[] = "$Id: ambient.c,v 2.124 2024/11/06 20:16:58 greg Exp $"; +static const char RCSid[] = "$Id: ambient.c,v 2.125 2024/11/11 19:01:55 greg Exp $"; /* * ambient.c - routines dealing with ambient (inter-reflected) component. * @@ -458,16 +458,15 @@ sumambient( /* get interpolated ambient value */ if (delta_r2 >= maxangle*maxangle) continue; /* - * Original ray behind test + * Modified ray behind test */ - d = 0.0; - for (j = 0; j < 3; j++) - d += (r->rop[j] - av->pos[j])*(r->ron[j] + uvw[2][j]); - d *= 0.5; + VSUB(ck0, r->rop, av->pos); + d = DOT(ck0, uvw[2]); if (d < -minarad*ambacc) continue; - /* Pre-empt following test if we can */ - if (fabs(d) >= av->rad[0]*ambacc) + d /= av->rad[0]; + delta_t2 = d*d; + if (delta_t2 >= ambacc*ambacc) continue; /* * Elliptical radii test based on Hessian